本文整理汇总了C++中ATRACE_CALL函数的典型用法代码示例。如果您正苦于以下问题:C++ ATRACE_CALL函数的具体用法?C++ ATRACE_CALL怎么用?C++ ATRACE_CALL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ATRACE_CALL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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
}
示例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;
}
示例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;
}
示例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;
}
示例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
}
示例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);
}
}
示例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());
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}