本文整理汇总了C++中ATRACE_CALL函数的典型用法代码示例。如果您正苦于以下问题:C++ ATRACE_CALL函数的具体用法?C++ ATRACE_CALL怎么用?C++ ATRACE_CALL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ATRACE_CALL函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ATRACE_CALL
status_t GraphicBufferMapper::unlock(buffer_handle_t handle)
{
ATRACE_CALL();
status_t err;
err = mAllocMod->unlock(mAllocMod, handle);
ALOGW_IF(err, "unlock(...) failed %d (%s)", err, strerror(-err));
return err;
}
开发者ID:JokeLook,项目名称:framework,代码行数:10,代码来源:GraphicBufferMapper.cpp
示例2: ATRACE_CALL
int Surface::queueBuffer(android_native_buffer_t* buffer, int fenceFd) {
ATRACE_CALL();
ALOGV("Surface::queueBuffer");
Mutex::Autolock lock(mMutex);
int64_t timestamp;
bool isAutoTimestamp = false;
if (mTimestamp == NATIVE_WINDOW_TIMESTAMP_AUTO) {
timestamp = systemTime(SYSTEM_TIME_MONOTONIC);
isAutoTimestamp = true;
ALOGV("Surface::queueBuffer making up timestamp: %.2f ms",
timestamp / 1000000.f);
} else {
timestamp = mTimestamp;
}
int i = getSlotFromBufferLocked(buffer);
if (i < 0) {
return i;
}
// Make sure the crop rectangle is entirely inside the buffer.
Rect crop;
mCrop.intersect(Rect(buffer->width, buffer->height), &crop);
#ifdef QCOM_BSP
Rect dirtyRect = mDirtyRect;
if(dirtyRect.isEmpty()) {
int drWidth = mUserWidth ? mUserWidth : mDefaultWidth;
int drHeight = mUserHeight ? mUserHeight : mDefaultHeight;
dirtyRect = Rect(drWidth, drHeight);
}
#endif
sp<Fence> fence(fenceFd >= 0 ? new Fence(fenceFd) : Fence::NO_FENCE);
IGraphicBufferProducer::QueueBufferOutput output;
IGraphicBufferProducer::QueueBufferInput input(timestamp, isAutoTimestamp,
crop,
#ifdef QCOM_BSP
dirtyRect,
#endif
mScalingMode, mTransform, mSwapIntervalZero,fence);
status_t err = mGraphicBufferProducer->queueBuffer(i, input, &output);
if (err != OK) {
ALOGE("queueBuffer: error queuing buffer to SurfaceTexture, %d", err);
}
uint32_t numPendingBuffers = 0;
output.deflate(&mDefaultWidth, &mDefaultHeight, &mTransformHint,
&numPendingBuffers);
mConsumerRunningBehind = (numPendingBuffers >= 2);
#ifdef QCOM_BSP
mDirtyRect.clear();
#endif
return err;
}
开发者ID:Angels-group,项目名称:cm11-p6-1,代码行数:55,代码来源:Surface.cpp
示例3: ATRACE_CALL
int SurfaceTextureClient::cancelBuffer(android_native_buffer_t* buffer) {
ATRACE_CALL();
ALOGV("SurfaceTextureClient::cancelBuffer");
Mutex::Autolock lock(mMutex);
int i = getSlotFromBufferLocked(buffer);
if (i < 0) {
return i;
}
mSurfaceTexture->cancelBuffer(i);
return OK;
}
开发者ID:frankinstine,项目名称:frameworks_native,代码行数:11,代码来源:SurfaceTextureClient.cpp
示例4: ATRACE_CALL
void BufferQueueConsumer::setConsumerName(const String8& name) {
ATRACE_CALL();
BQ_LOGV("setConsumerName: '%s'", name.string());
Mutex::Autolock lock(mCore->mMutex);
mCore->mConsumerName = name;
mConsumerName = name;
#ifdef MTK_AOSP_ENHANCEMENT
// update dump info and prepare for drawing debug line
mCore->debugger.onSetConsumerName(name);
#endif
}
开发者ID:aurorarom,项目名称:JsonUtil,代码行数:11,代码来源:BufferQueueConsumer.cpp
示例5: ATRACE_CALL
status_t GLConsumer::attachToContext(uint32_t tex) {
ATRACE_CALL();
#ifndef MTK_DEFAULT_AOSP
ST_LOGI("attachToContext");
#else
ST_LOGV("attachToContext");
#endif
Mutex::Autolock lock(mMutex);
if (mAbandoned) {
ST_LOGE("attachToContext: abandoned GLConsumer");
return NO_INIT;
}
if (mAttached) {
ST_LOGE("attachToContext: GLConsumer is already attached to a "
"context");
return INVALID_OPERATION;
}
EGLDisplay dpy = eglGetCurrentDisplay();
EGLContext ctx = eglGetCurrentContext();
if (dpy == EGL_NO_DISPLAY) {
ST_LOGE("attachToContext: invalid current EGLDisplay");
return INVALID_OPERATION;
}
if (ctx == EGL_NO_CONTEXT) {
ST_LOGE("attachToContext: invalid current EGLContext");
return INVALID_OPERATION;
}
// We need to bind the texture regardless of whether there's a current
// buffer.
glBindTexture(mTexTarget, GLuint(tex));
if (mCurrentTextureBuf != NULL) {
// The EGLImageKHR that was associated with the slot was destroyed when
// the GLConsumer was detached from the old context, so we need to
// recreate it here.
status_t err = bindUnslottedBufferLocked(dpy);
if (err != NO_ERROR) {
return err;
}
}
mEglDisplay = dpy;
mEglContext = ctx;
mTexName = tex;
mAttached = true;
return OK;
}
开发者ID:WayWingsDev,项目名称:Source_MT6582,代码行数:54,代码来源:GLConsumer.cpp
示例6: ATRACE_CALL
status_t Camera3Stream::tearDown() {
ATRACE_CALL();
Mutex::Autolock l(mLock);
status_t res = OK;
// This function should be only called when the stream is configured.
if (mState != STATE_CONFIGURED) {
ALOGE("%s: Stream %d: Can't tear down stream if stream is not in "
"CONFIGURED state %d", __FUNCTION__, mId, mState);
return INVALID_OPERATION;
}
// If any buffers have been handed to the HAL, the stream cannot be torn down.
if (getHandoutOutputBufferCountLocked() > 0) {
ALOGE("%s: Stream %d: Can't tear down a stream that has outstanding buffers",
__FUNCTION__, mId);
return INVALID_OPERATION;
}
// Free buffers by disconnecting and then reconnecting to the buffer queue
// Only unused buffers will be dropped immediately; buffers that have been filled
// and are waiting to be acquired by the consumer and buffers that are currently
// acquired will be freed once they are released by the consumer.
res = disconnectLocked();
if (res != OK) {
if (res == -ENOTCONN) {
// queue has been disconnected, nothing left to do, so exit with success
return OK;
}
ALOGE("%s: Stream %d: Unable to disconnect to tear down buffers: %s (%d)",
__FUNCTION__, mId, strerror(-res), res);
return res;
}
mState = STATE_IN_CONFIG;
res = configureQueueLocked();
if (res != OK) {
ALOGE("%s: Unable to configure stream %d queue: %s (%d)",
__FUNCTION__, mId, strerror(-res), res);
mState = STATE_ERROR;
return res;
}
// Reset prepared state, since we've reconnected to the queue and can prepare again.
mPrepared = false;
mStreamUnpreparable = false;
mState = STATE_CONFIGURED;
return OK;
}
开发者ID:android-source,项目名称:platform_frameworks_av,代码行数:54,代码来源:Camera3Stream.cpp
示例7: ATRACE_CALL
status_t ZslProcessor::processNewZslBuffer() {
ATRACE_CALL();
status_t res;
sp<BufferItemConsumer> zslConsumer;
{
Mutex::Autolock l(mInputMutex);
if (mZslConsumer == 0) return OK;
zslConsumer = mZslConsumer;
}
ALOGVV("Trying to get next buffer");
BufferItemConsumer::BufferItem item;
res = zslConsumer->acquireBuffer(&item, 0);
if (res != OK) {
if (res != BufferItemConsumer::NO_BUFFER_AVAILABLE) {
ALOGE("%s: Camera %d: Error receiving ZSL image buffer: "
"%s (%d)", __FUNCTION__,
mId, strerror(-res), res);
} else {
ALOGVV(" No buffer");
}
return res;
}
Mutex::Autolock l(mInputMutex);
if (mState == LOCKED) {
ALOGVV("In capture, discarding new ZSL buffers");
zslConsumer->releaseBuffer(item);
return OK;
}
ALOGVV("Got ZSL buffer: head: %d, tail: %d", mZslQueueHead, mZslQueueTail);
if ( (mZslQueueHead + 1) % kZslBufferDepth == mZslQueueTail) {
ALOGVV("Releasing oldest buffer");
zslConsumer->releaseBuffer(mZslQueue[mZslQueueTail].buffer);
mZslQueue.replaceAt(mZslQueueTail);
mZslQueueTail = (mZslQueueTail + 1) % kZslBufferDepth;
}
ZslPair &queueHead = mZslQueue.editItemAt(mZslQueueHead);
queueHead.buffer = item;
queueHead.frame.release();
mZslQueueHead = (mZslQueueHead + 1) % kZslBufferDepth;
ALOGVV(" Acquired buffer, timestamp %" PRId64, queueHead.buffer.mTimestamp);
findMatchesLocked();
return OK;
}
开发者ID:DARKPOP,项目名称:frameworks_av,代码行数:53,代码来源:ZslProcessor.cpp
示例8: ATRACE_CALL
void ShadowTessellator::tessellateSpotShadow(bool isCasterOpaque,
const Vector3* casterPolygon, int casterVertexCount, const Vector3& casterCentroid,
const mat4& receiverTransform, const Vector3& lightCenter, int lightRadius,
const Rect& casterBounds, const Rect& localClip, VertexBuffer& shadowVertexBuffer) {
ATRACE_CALL();
Caches& caches = Caches::getInstance();
Vector3 adjustedLightCenter(lightCenter);
if (CC_UNLIKELY(caches.propertyLightPosY > 0)) {
adjustedLightCenter.y = - caches.propertyLightPosY; // negated since this shifts up
}
if (CC_UNLIKELY(caches.propertyLightPosZ > 0)) {
adjustedLightCenter.z = caches.propertyLightPosZ;
}
#if DEBUG_SHADOW
ALOGD("light center %f %f %f",
adjustedLightCenter.x, adjustedLightCenter.y, adjustedLightCenter.z);
#endif
// light position (because it's in local space) needs to compensate for receiver transform
// TODO: should apply to light orientation, not just position
Matrix4 reverseReceiverTransform;
reverseReceiverTransform.loadInverse(receiverTransform);
reverseReceiverTransform.mapPoint3d(adjustedLightCenter);
const int lightVertexCount = 8;
if (CC_UNLIKELY(caches.propertyLightDiameter > 0)) {
lightRadius = caches.propertyLightDiameter;
}
// Now light and caster are both in local space, we will check whether
// the shadow is within the clip area.
Rect lightRect = Rect(adjustedLightCenter.x - lightRadius, adjustedLightCenter.y - lightRadius,
adjustedLightCenter.x + lightRadius, adjustedLightCenter.y + lightRadius);
lightRect.unionWith(localClip);
if (!lightRect.intersects(casterBounds)) {
#if DEBUG_SHADOW
ALOGD("Spot shadow is out of clip rect!");
#endif
return;
}
SpotShadow::createSpotShadow(isCasterOpaque, adjustedLightCenter, lightRadius,
casterPolygon, casterVertexCount, casterCentroid, shadowVertexBuffer);
#if DEBUG_SHADOW
if(shadowVertexBuffer.getVertexCount() <= 0) {
ALOGD("Spot shadow generation failed %d", shadowVertexBuffer.getVertexCount());
}
#endif
}
开发者ID:manuelmagix,项目名称:android_frameworks_base,代码行数:53,代码来源:ShadowTessellator.cpp
示例9: ATRACE_CALL
void CanvasContext::trimMemory(RenderThread& thread, int level) {
// No context means nothing to free
if (!thread.eglManager().hasEglContext()) return;
ATRACE_CALL();
if (level >= TRIM_MEMORY_COMPLETE) {
Caches::getInstance().flush(Caches::kFlushMode_Full);
thread.eglManager().destroy();
} else if (level >= TRIM_MEMORY_UI_HIDDEN) {
Caches::getInstance().flush(Caches::kFlushMode_Moderate);
}
}
开发者ID:020gzh,项目名称:platform_frameworks_base,代码行数:12,代码来源:CanvasContext.cpp
示例10: ATRACE_CALL
/**
* Organizes the DisplayList hierarchy to prepare for background projection reordering.
*
* This should be called before a call to defer() or drawDisplayList()
*
* Each DisplayList that serves as a 3d root builds its list of composited children,
* which are flagged to not draw in the standard draw loop.
*/
void RenderNode::computeOrdering() {
ATRACE_CALL();
mProjectedNodes.clear();
// TODO: create temporary DDLOp and call computeOrderingImpl on top DisplayList so that
// transform properties are applied correctly to top level children
if (mDisplayList == nullptr) return;
for (unsigned int i = 0; i < mDisplayList->getChildren().size(); i++) {
renderNodeOp_t* childOp = mDisplayList->getChildren()[i];
childOp->renderNode->computeOrderingImpl(childOp, &mProjectedNodes, &mat4::identity());
}
}
开发者ID:rockinroyle,项目名称:platform_frameworks_base,代码行数:20,代码来源:RenderNode.cpp
示例11: hwc_set
static int hwc_set(struct hwc_composer_device_1 *dev,
size_t numDisplays,
hwc_display_contents_1_t **displays)
{
ATRACE_CALL();
GET_HWC_RETURN_ERROR_IF_NULL();
if (!hwc->commit(numDisplays, displays)) {
ELOGTRACE("failed to commit");
return -EINVAL;
}
return 0;
}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_hardware_intel,代码行数:12,代码来源:HwcModule.cpp
示例12: hwc_setActiveConfig
static int hwc_setActiveConfig(hwc_composer_device_1_t *dev, int disp, int index)
{
ATRACE_CALL();
GET_HWC_RETURN_ERROR_IF_NULL();
bool ret = hwc->setActiveConfig(disp, index);
if (ret == false) {
WLOGTRACE("failed to set active config of disp %d", disp);
return -EINVAL;
}
return 0;
}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_hardware_intel,代码行数:12,代码来源:HwcModule.cpp
示例13: hwc_setCursorPositionAsync
static int hwc_setCursorPositionAsync(hwc_composer_device_1_t *dev, int disp, int x, int y)
{
ATRACE_CALL();
GET_HWC_RETURN_ERROR_IF_NULL();
bool ret = hwc->setCursorPositionAsync(disp, x, y);
if (ret == false) {
WLOGTRACE("failed to set cursor position of disp %d", disp);
return -EINVAL;
}
return 0;
}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_hardware_intel,代码行数:12,代码来源:HwcModule.cpp
示例14: hwc_setPowerMode
static int hwc_setPowerMode(hwc_composer_device_1_t *dev, int disp, int mode)
{
ATRACE_CALL();
GET_HWC_RETURN_ERROR_IF_NULL();
bool ret = hwc->setPowerMode(disp, mode);
if (ret == false) {
WLOGTRACE("failed to set power mode of disp %d", disp);
return -EINVAL;
}
return 0;
}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_hardware_intel,代码行数:12,代码来源:HwcModule.cpp
示例15: hwc_getActiveConfig
static int hwc_getActiveConfig(hwc_composer_device_1_t *dev, int disp)
{
ATRACE_CALL();
GET_HWC_RETURN_ERROR_IF_NULL();
int ret = hwc->getActiveConfig(disp);
if (ret == -1) {
WLOGTRACE("failed to get active config of disp %d", disp);
return -EINVAL;
}
return ret;
}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_hardware_intel,代码行数:12,代码来源:HwcModule.cpp
示例16: hwc_blank
static int hwc_blank(hwc_composer_device_1_t *dev, int disp, int blank)
{
ATRACE_CALL();
GET_HWC_RETURN_ERROR_IF_NULL();
bool ret = hwc->blank(disp, blank);
if (ret == false) {
ELOGTRACE("failed to blank disp %d, blank %d", disp, blank);
return -EINVAL;
}
return 0;
}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_hardware_intel,代码行数:12,代码来源:HwcModule.cpp
示例17: hwc_compositionComplete
static int hwc_compositionComplete(hwc_composer_device_1_t *dev, int disp)
{
ATRACE_CALL();
GET_HWC_RETURN_ERROR_IF_NULL();
bool ret = hwc->compositionComplete(disp);
if (ret == false) {
ELOGTRACE("failed for disp %d", disp);
return -EINVAL;
}
return 0;
}
开发者ID:PDi-Communication-Systems-Inc,项目名称:lollipop_hardware_intel,代码行数:12,代码来源:HwcModule.cpp
示例18: ATRACE_CALL
status_t GraphicBufferAllocator::alloc(uint32_t w, uint32_t h, PixelFormat format,
int usage, buffer_handle_t* handle, int32_t* stride)
{
ATRACE_CALL();
// make sure to not allocate a N x 0 or 0 x N buffer, since this is
// allowed from an API stand-point allocate a 1x1 buffer instead.
if (!w || !h)
w = h = 1;
// we have a h/w allocator and h/w buffer is requested
status_t err;
// If too many async frees are queued up then wait for some of them to
// complete before attempting to allocate more memory. This is exercised
// by the android.opengl.cts.GLSurfaceViewTest CTS test.
BufferLiberatorThread::maybeWaitForLiberation();
err = mAllocDev->alloc(mAllocDev, w, h, format, usage, handle, stride);
if (err != NO_ERROR) {
ALOGW("WOW! gralloc alloc failed, waiting for pending frees!");
BufferLiberatorThread::waitForLiberation();
err = mAllocDev->alloc(mAllocDev, w, h, format, usage, handle, stride);
}
ALOGW_IF(err, "alloc(%u, %u, %d, %08x, ...) failed %d (%s)",
w, h, format, usage, err, strerror(-err));
if (err == NO_ERROR) {
Mutex::Autolock _l(sLock);
KeyedVector<buffer_handle_t, alloc_rec_t>& list(sAllocList);
int bpp = bytesPerPixel(format);
if (bpp < 0) {
// probably a HAL custom format. in any case, we don't know
// what its pixel size is.
bpp = 0;
}
alloc_rec_t rec;
rec.w = w;
rec.h = h;
rec.s = *stride;
rec.format = format;
rec.usage = usage;
rec.size = h * stride[0] * bpp;
// [MTK] {{{
rec.pid = IPCThreadState::self()->getCallingPid();
// [MTK] }}}
list.add(*handle, rec);
}
return err;
}
开发者ID:4Fwolf,项目名称:mt6572_x201,代码行数:52,代码来源:GraphicBufferAllocator.cpp
示例19: ATRACE_CALL
int SurfaceTextureClient::cancelBuffer(android_native_buffer_t* buffer,
int fenceFd) {
ATRACE_CALL();
ALOGV("SurfaceTextureClient::cancelBuffer");
Mutex::Autolock lock(mMutex);
int i = getSlotFromBufferLocked(buffer);
if (i < 0) {
return i;
}
sp<Fence> fence(fenceFd >= 0 ? new Fence(fenceFd) : NULL);
mSurfaceTexture->cancelBuffer(i, fence);
return OK;
}
开发者ID:bywang,项目名称:android_frameworks_native,代码行数:13,代码来源:SurfaceTextureClient.cpp
示例20: ATRACE_CALL
sp<Fence> Fence::merge(const String8& name, const sp<Fence>& f1,
const sp<Fence>& f2) {
ATRACE_CALL();
int result = sync_merge(name.string(), f1->mFenceFd, f2->mFenceFd);
if (result == -1) {
status_t err = -errno;
ALOGE("merge: sync_merge(\"%s\", %d, %d) returned an error: %s (%d)",
name.string(), f1->mFenceFd, f2->mFenceFd,
strerror(-err), err);
return NO_FENCE;
}
return sp<Fence>(new Fence(result));
}
开发者ID:Proshivalskiy,项目名称:MT6582_kernel_source,代码行数:13,代码来源:Fence.cpp
注:本文中的ATRACE_CALL函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论