您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CC_UNLIKELY函数代码示例

51自学网 2021-06-01 19:57:51
  C++
这篇教程C++ CC_UNLIKELY函数代码示例写得很实用,希望能帮到您。

本文整理汇总了C++中CC_UNLIKELY函数的典型用法代码示例。如果您正苦于以下问题:C++ CC_UNLIKELY函数的具体用法?C++ CC_UNLIKELY怎么用?C++ CC_UNLIKELY使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。

在下文中一共展示了CC_UNLIKELY函数的28个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ALOGE

void FenceTime::applyTrustedSnapshot(const Snapshot& src) {    if (CC_UNLIKELY(src.state != Snapshot::State::SIGNAL_TIME)) {        // Applying Snapshot::State::FENCE, could change the valid state of the        // FenceTime, which is not allowed. Callers should create a new        // FenceTime from the snapshot instead.        ALOGE("applyTrustedSnapshot: Unexpected fence.");        return;    }    if (src.state == Snapshot::State::EMPTY) {        return;    }    nsecs_t signalTime = mSignalTime.load(std::memory_order_relaxed);    if (signalTime != Fence::SIGNAL_TIME_PENDING) {        // We should always get the same signalTime here that we did in        // getSignalTime(). This check races with getSignalTime(), but it is        // only a sanity check so that's okay.        if (CC_UNLIKELY(signalTime != src.signalTime)) {            ALOGE("FenceTime::applyTrustedSnapshot: signalTime mismatch. "                    "(%" PRId64 " (old) != %" PRId64 " (new))",                    signalTime, src.signalTime);        }        return;    }    std::lock_guard<std::mutex> lock(mMutex);    mFence.clear();    mSignalTime.store(src.signalTime, std::memory_order_relaxed);}
开发者ID:MIPS,项目名称:frameworks-native,代码行数:30,


示例2: ALOG_ASSERT

ssize_t AudioBufferProviderSource::read(void *buffer,                                        size_t count,                                        int64_t readPTS){    if (CC_UNLIKELY(!mNegotiated)) {        return NEGOTIATE;    }    if (CC_UNLIKELY(mBuffer.raw == NULL)) {        mBuffer.frameCount = count;        status_t status = mProvider->getNextBuffer(&mBuffer, readPTS);        if (status != OK) {            return status == NOT_ENOUGH_DATA ? (ssize_t) WOULD_BLOCK : (ssize_t) status;        }        ALOG_ASSERT(mBuffer.raw != NULL);        // mConsumed is 0 either from constructor or after releaseBuffer()    }    size_t available = mBuffer.frameCount - mConsumed;    if (CC_UNLIKELY(count > available)) {        count = available;    }    // count could be zero, either because count was zero on entry or    // available is zero, but both are unlikely so don't check for that    memcpy(buffer, (char *) mBuffer.raw + (mConsumed << mBitShift), count << mBitShift);    if (CC_UNLIKELY((mConsumed += count) >= mBuffer.frameCount)) {        mProvider->releaseBuffer(&mBuffer);        mBuffer.raw = NULL;        mConsumed = 0;    }    mFramesRead += count;    // For better responsiveness with large values of count,    // return a short count rather than continuing with next buffer.    // This gives the caller a chance to interpolate other actions.    return count;}
开发者ID:3dsfr3ak,项目名称:android_frameworks_av,代码行数:34,


示例3: 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,


示例4: applyClip

void Snapshot::applyClip(const ClipBase* recordedClip, const Matrix4& transform) {    if (CC_UNLIKELY(recordedClip && recordedClip->intersectWithRoot)) {        // current clip is being replaced, but must intersect with clip root        *mClipArea = *(getClipRoot(this)->mClipArea);    }    mClipArea->applyClip(recordedClip, transform);}
开发者ID:AlanCheen,项目名称:platform_frameworks_base,代码行数:7,


示例5: setDensity

void FrameInfoVisualizer::setDensity(float density) {    if (CC_UNLIKELY(mDensity != density)) {        mDensity = density;        mVerticalUnit = dpToPx(PROFILE_DRAW_DP_PER_MS, density);        mThresholdStroke = dpToPx(PROFILE_DRAW_THRESHOLD_STROKE_WIDTH, density);    }}
开发者ID:AlanCheen,项目名称:platform_frameworks_base,代码行数:7,


示例6: mWidth

/** * CameraBuffer * * Constructor for buffers allocated using mmap * * /param fd [IN] File descriptor to map * /param length [IN] amount of data to map * /param v4l2fmt [IN] Pixel format in V4L2 enum * /param offset [IN] offset from the begining of the file (mmap param) * /param prot [IN] memory protection (mmap param) * /param flags [IN] flags (mmap param) * * Success of the mmap can be queried by checking the size of the resulting * buffer */CameraBuffer::CameraBuffer(int fd, int length, int v4l2fmt, int offset,                           int prot, int flags):        mWidth(1),        mHeight(length),        mSize(0),        mFormat(0),        mV4L2Fmt(v4l2fmt),        mStride(1),        mInit(false),        mLocked(false),        mType(BUF_TYPE_MMAP),        mOwner(NULL),        mDataPtr(NULL),        mRequestID(0){    mDataPtr = mmap(NULL, length, prot, flags, fd, offset);    if (CC_UNLIKELY(mDataPtr == MAP_FAILED)) {        LOGE("Failed to MMAP the buffer %s", strerror(errno));        mDataPtr = NULL;        return;    }    mLocked = true;    mInit = true;    mSize = length;    CLEAR(mUserBuffer);    mUserBuffer.release_fence = -1;    mUserBuffer.acquire_fence = -1;    LOG1("mmaped address for  %p length %d", mDataPtr, mSize);}
开发者ID:yutokt,项目名称:android_vendor_intel,代码行数:45,


示例7: LOGE

status_t ResultProcessor::handleRegisterRequest(Message &msg){    status_t status = NO_ERROR;    RequestState_t* reqState;    int reqId = msg.request->getId();    /**     * check if the request was not already register. we may receive registration     * request duplicated in case of request that are held by the PSL     */    if(mRequestsInTransit.indexOfKey(reqId) != NAME_NOT_FOUND) {        return NO_ERROR;    }    status = mReqStatePool.acquireItem(&reqState);    if (status != NO_ERROR) {        LOGE("Could not acquire an empty reqState from the pool");        return status;    }    reqState->init(msg.request);    mRequestsInTransit.add(reqState->reqId, reqState);    LOGR("<request %d> registered @ ResultProcessor", reqState->reqId);    /**     * get the number of partial results the request may return, this is not     *  going to change once the camera is open, so do it only once.     *  We initialize the value to 0, the minimum value should be 1     */    if (CC_UNLIKELY(mPartialResultCount == 0)) {        mPartialResultCount = msg.request->getpartialResultCount();    }    return status;}
开发者ID:yutokt,项目名称:android_vendor_intel,代码行数:32,


示例8: endFrame

void BakedOpRenderer::endFrame(const Rect& repaintRect) {    if (CC_UNLIKELY(Properties::debugOverdraw)) {        ClipRect overdrawClip(repaintRect);        Rect viewportRect(mRenderTarget.viewportWidth, mRenderTarget.viewportHeight);        // overdraw visualization        for (int i = 1; i <= 4; i++) {            if (i < 4) {                // nth level of overdraw tests for n+1 draws per pixel                mRenderState.stencil().enableDebugTest(i + 1, false);            } else {                // 4th level tests for 4 or higher draws per pixel                mRenderState.stencil().enableDebugTest(4, true);            }            SkPaint paint;            paint.setColor(mCaches.getOverdrawColor(i));            Glop glop;            GlopBuilder(mRenderState, mCaches, &glop)                    .setRoundRectClipState(nullptr)                    .setMeshUnitQuad()                    .setFillPaint(paint, 1.0f)                    .setTransform(Matrix4::identity(), TransformFlags::None)                    .setModelViewMapUnitToRect(viewportRect)                    .build();            renderGlop(nullptr, &overdrawClip, glop);        }        mRenderState.stencil().disable();    }    // Note: we leave FBO 0 renderable here, for post-frame-content decoration}
开发者ID:debian-pkg-android-tools,项目名称:android-platform-frameworks-base,代码行数:31,


示例9: onPositionLost

        virtual void onPositionLost(RenderNode& node, const TreeInfo* info) override {            if (CC_UNLIKELY(!mWeakRef || (info && !info->updateWindowPositions))) return;            ATRACE_NAME("SurfaceView position lost");            JNIEnv* env = jnienv();            jobject localref = env->NewLocalRef(mWeakRef);            if (CC_UNLIKELY(!localref)) {                jnienv()->DeleteWeakGlobalRef(mWeakRef);                mWeakRef = nullptr;                return;            }            env->CallVoidMethod(localref, gSurfaceViewPositionLostMethod,                    info ? info->canvasContext.getFrameNumber() : 0);            env->DeleteLocalRef(localref);        }
开发者ID:rockinroyle,项目名称:platform_frameworks_base,代码行数:16,


示例10: onPositionUpdated

        virtual void onPositionUpdated(RenderNode& node, const TreeInfo& info) override {            if (CC_UNLIKELY(!mWeakRef || !info.updateWindowPositions)) return;            Matrix4 transform;            info.damageAccumulator->computeCurrentTransform(&transform);            const RenderProperties& props = node.properties();            uirenderer::Rect bounds(props.getWidth(), props.getHeight());            transform.mapRect(bounds);            bounds.left -= info.windowInsetLeft;            bounds.right -= info.windowInsetLeft;            bounds.top -= info.windowInsetTop;            bounds.bottom -= info.windowInsetTop;            if (CC_LIKELY(transform.isPureTranslate())) {                // snap/round the computed bounds, so they match the rounding behavior                // of the clear done in SurfaceView#draw().                bounds.snapToPixelBoundaries();            } else {                // Conservatively round out so the punched hole (in the ZOrderOnTop = true case)                // doesn't extend beyond the other window                bounds.roundOut();            }            incStrong(0);            auto functor = std::bind(                std::mem_fn(&SurfaceViewPositionUpdater::doUpdatePositionAsync), this,                (jlong) info.canvasContext.getFrameNumber(),                (jint) bounds.left, (jint) bounds.top,                (jint) bounds.right, (jint) bounds.bottom);            info.canvasContext.enqueueFrameWork(std::move(functor));        }
开发者ID:rockinroyle,项目名称:platform_frameworks_base,代码行数:32,


示例11: availableToRead

ssize_t AudioBufferProviderSource::availableToRead(){    if (CC_UNLIKELY(!mNegotiated)) {        return NEGOTIATE;    }    return mBuffer.raw != NULL ? mBuffer.frameCount - mConsumed : 0;}
开发者ID:3dsfr3ak,项目名称:android_frameworks_av,代码行数:7,


示例12: _l

bool egl_display_t::HibernationMachine::incWakeCount(WakeRefStrength strength) {    Mutex::Autolock _l(mLock);    ALOGE_IF(mWakeCount < 0 || mWakeCount == INT32_MAX,             "Invalid WakeCount (%d) on enter/n", mWakeCount);    mWakeCount++;    if (strength == STRONG)        mAttemptHibernation = false;    if (CC_UNLIKELY(mHibernating)) {        ALOGV("Awakening/n");        egl_connection_t* const cnx = &gEGLImpl;        // These conditions should be guaranteed before entering hibernation;        // we don't want to get into a state where we can't wake up.        ALOGD_IF(!mDpyValid || !cnx->egl.eglAwakenProcessIMG,                 "Invalid hibernation state, unable to awaken/n");        if (!cnx->egl.eglAwakenProcessIMG()) {            ALOGE("Failed to awaken EGL implementation/n");            return false;        }        mHibernating = false;    }    return true;}
开发者ID:shevchenator,项目名称:wand_frameworks,代码行数:26,


示例13: swapBuffers

bool EglManager::swapBuffers(const Frame& frame, const SkRect& screenDirty) {    if (CC_UNLIKELY(Properties::waitForGpuCompletion)) {        ATRACE_NAME("Finishing GPU work");        fence();    }    EGLint rects[4];    frame.map(screenDirty, rects);    eglSwapBuffersWithDamageKHR(mEglDisplay, frame.mSurface, rects, screenDirty.isEmpty() ? 0 : 1);    EGLint err = eglGetError();    if (CC_LIKELY(err == EGL_SUCCESS)) {        return true;    }    if (err == EGL_BAD_SURFACE || err == EGL_BAD_NATIVE_WINDOW) {        // For some reason our surface was destroyed out from under us        // This really shouldn't happen, but if it does we can recover easily        // by just not trying to use the surface anymore        ALOGW("swapBuffers encountered EGL error %d on %p, halting rendering...", err,              frame.mSurface);        return false;    }    LOG_ALWAYS_FATAL("Encountered EGL error %d %s during rendering", err, egl_error_str(err));    // Impossible to hit this, but the compiler doesn't know that    return false;}
开发者ID:AlanCheen,项目名称:platform_frameworks_base,代码行数:26,


示例14: _l

BpBinder* BpBinder::create(int32_t handle) {    int32_t trackedUid = -1;    if (sCountByUidEnabled) {        trackedUid = IPCThreadState::self()->getCallingUid();        AutoMutex _l(sTrackingLock);        uint32_t trackedValue = sTrackingMap[trackedUid];        if (CC_UNLIKELY(trackedValue & LIMIT_REACHED_MASK)) {            if (sBinderProxyThrottleCreate) {                return nullptr;            }        } else {            if ((trackedValue & COUNTING_VALUE_MASK) >= sBinderProxyCountHighWatermark) {                ALOGE("Too many binder proxy objects sent to uid %d from uid %d (%d proxies held)",                      getuid(), trackedUid, trackedValue);                sTrackingMap[trackedUid] |= LIMIT_REACHED_MASK;                if (sLimitCallback) sLimitCallback(trackedUid);                if (sBinderProxyThrottleCreate) {                    ALOGI("Throttling binder proxy creates from uid %d in uid %d until binder proxy"                          " count drops below %d",                          trackedUid, getuid(), sBinderProxyCountLowWatermark);                    return nullptr;                }            }        }        sTrackingMap[trackedUid]++;    }    return new BpBinder(handle, trackedUid);}
开发者ID:chengyi818,项目名称:kata,代码行数:28,


示例15: _l

sp<GraphicBuffer> GLConsumer::getDebugTexImageBuffer() {    Mutex::Autolock _l(sStaticInitLock);    if (CC_UNLIKELY(sReleasedTexImageBuffer == NULL)) {        // The first time, create the debug texture in case the application        // continues to use it.        sp<GraphicBuffer> buffer = new GraphicBuffer(                kDebugData.width, kDebugData.height, PIXEL_FORMAT_RGBA_8888,                GraphicBuffer::USAGE_SW_WRITE_RARELY);        uint32_t* bits;        buffer->lock(GraphicBuffer::USAGE_SW_WRITE_RARELY, reinterpret_cast<void**>(&bits));        uint32_t stride = buffer->getStride();        uint32_t height = buffer->getHeight();        memset(bits, 0, stride * height * 4);        for (uint32_t y = 0; y < kDebugData.height; y++) {            for (uint32_t x = 0; x < kDebugData.width; x++) {                bits[x] = (kDebugData.bits[y + kDebugData.width + x] == 'X') ?                    0xFF000000 : 0xFFFFFFFF;            }            bits += stride;        }        buffer->unlock();        sReleasedTexImageBuffer = buffer;    }    return sReleasedTexImageBuffer;}
开发者ID:Hazy-legacy-zf2,项目名称:platform_frameworks_native,代码行数:25,


示例16: switch

bool Snapshot::clipTransformed(const Rect& r, SkRegion::Op op) {    bool clipped = false;    switch (op) {        case SkRegion::kIntersect_Op: {            if (CC_UNLIKELY(!clipRegion->isEmpty())) {                ensureClipRegion();                clipped = clipRegionOp(r.left, r.top, r.right, r.bottom, SkRegion::kIntersect_Op);            } else {                clipped = clipRect->intersect(r);                if (!clipped) {                    clipRect->setEmpty();                    clipped = true;                }            }            break;        }        case SkRegion::kReplace_Op: {            setClip(r.left, r.top, r.right, r.bottom);            clipped = true;            break;        }        default: {            ensureClipRegion();            clipped = clipRegionOp(r.left, r.top, r.right, r.bottom, op);            break;        }    }    if (clipped) {        flags |= Snapshot::kFlagClipSet;    }    return clipped;}
开发者ID:AOSP-JF,项目名称:platform_frameworks_base,代码行数:35,


示例17: flushLayerClears

void LayerBuilder::flushLayerClears(LinearAllocator& allocator) {    if (CC_UNLIKELY(!mClearRects.empty())) {        const int vertCount = mClearRects.size() * 4;        // put the verts in the frame allocator, since        //     1) SimpleRectsOps needs verts, not rects        //     2) even if mClearRects stored verts, std::vectors will move their contents        Vertex* const verts = (Vertex*) allocator.create_trivial_array<Vertex>(vertCount);        Vertex* currentVert = verts;        Rect bounds = mClearRects[0];        for (auto&& rect : mClearRects) {            bounds.unionWith(rect);            Vertex::set(currentVert++, rect.left, rect.top);            Vertex::set(currentVert++, rect.right, rect.top);            Vertex::set(currentVert++, rect.left, rect.bottom);            Vertex::set(currentVert++, rect.right, rect.bottom);        }        mClearRects.clear(); // discard rects before drawing so this method isn't reentrant        // One or more unclipped saveLayers have been enqueued, with deferred clears.        // Flush all of these clears with a single draw        SkPaint* paint = allocator.create<SkPaint>();        paint->setXfermodeMode(SkXfermode::kClear_Mode);        SimpleRectsOp* op = allocator.create_trivial<SimpleRectsOp>(bounds,                Matrix4::identity(), nullptr, paint,                verts, vertCount);        BakedOpState* bakedState = BakedOpState::directConstruct(allocator,                &repaintClip, bounds, *op);        deferUnmergeableOp(allocator, bakedState, OpBatchType::Vertices);    }}
开发者ID:debian-pkg-android-tools,项目名称:android-platform-frameworks-base,代码行数:31,


示例18: get_camera_metadata_tag_type

status_t CameraMetadata::checkType(uint32_t tag, uint8_t expectedType) {    int tagType = get_camera_metadata_tag_type(tag);    if ( CC_UNLIKELY(tagType == -1)) {        ALOGE("Update metadata entry: Unknown tag %d", tag);        return INVALID_OPERATION;    }    if ( CC_UNLIKELY(tagType != expectedType) ) {        ALOGE("Mismatched tag type when updating entry %s (%d) of type %s; "                "got type %s data instead ",                get_camera_metadata_tag_name(tag), tag,                camera_metadata_type_names[tagType],                camera_metadata_type_names[expectedType]);        return INVALID_OPERATION;    }    return OK;}
开发者ID:3dsfr3ak,项目名称:android_frameworks_av,代码行数:16,


示例19: ALOGV

BpBinder::~BpBinder(){    ALOGV("Destroying BpBinder %p handle %d/n", this, mHandle);    IPCThreadState* ipc = IPCThreadState::self();    if (mTrackedUid >= 0) {        AutoMutex _l(sTrackingLock);        uint32_t trackedValue = sTrackingMap[mTrackedUid];        if (CC_UNLIKELY((trackedValue & COUNTING_VALUE_MASK) == 0)) {            ALOGE("Unexpected Binder Proxy tracking decrement in %p handle %d/n", this, mHandle);        } else {            if (CC_UNLIKELY(                (trackedValue & LIMIT_REACHED_MASK) &&                ((trackedValue & COUNTING_VALUE_MASK) <= sBinderProxyCountLowWatermark)                )) {                ALOGI("Limit reached bit reset for uid %d (fewer than %d proxies from uid %d held)",                                   getuid(), mTrackedUid, sBinderProxyCountLowWatermark);                sTrackingMap[mTrackedUid] &= ~LIMIT_REACHED_MASK;            }            if (--sTrackingMap[mTrackedUid] == 0) {                sTrackingMap.erase(mTrackedUid);            }        }    }    mLock.lock();    Vector<Obituary>* obits = mObituaries;    if(obits != NULL) {        if (ipc) ipc->clearDeathNotification(mHandle, this);        mObituaries = NULL;    }    mLock.unlock();    if (obits != NULL) {        // XXX Should we tell any remaining DeathRecipient        // objects that the last strong ref has gone away, so they        // are no longer linked?        delete obits;    }    if (ipc) {        ipc->expungeHandle(mHandle, this);        ipc->decWeakHandle(mHandle);    }}
开发者ID:chengyi818,项目名称:kata,代码行数:46,


示例20: setDensity

void DrawProfiler::setDensity(float density) {    if (CC_UNLIKELY(mDensity != density)) {        mDensity = density;        mVerticalUnit = dpToPx(PROFILE_DRAW_DP_PER_MS, density);        mHorizontalUnit = dpToPx(PROFILE_DRAW_WIDTH, density);        mThresholdStroke = dpToPx(PROFILE_DRAW_THRESHOLD_STROKE_WIDTH, density);    }}
开发者ID:AOSP-JF,项目名称:platform_frameworks_base,代码行数:8,


示例21: onDraw

void Layer::onDraw(const Region& clip) const{    if (CC_UNLIKELY(mActiveBuffer == 0)) {        // the texture has not been created yet, this Layer has        // in fact never been drawn into. This happens frequently with        // SurfaceView because the WindowManager can't know when the client        // has drawn the first time.        // If there is nothing under us, we paint the screen in black, otherwise        // we just skip this update.        // figure out if there is something below us        Region under;        const SurfaceFlinger::LayerVector& drawingLayers(                mFlinger->mDrawingState.layersSortedByZ);        const size_t count = drawingLayers.size();        for (size_t i=0 ; i<count ; ++i) {            const sp<LayerBase>& layer(drawingLayers[i]);            if (layer.get() == static_cast<LayerBase const*>(this))                break;            under.orSelf(layer->visibleRegionScreen);        }        // if not everything below us is covered, we plug the holes!        Region holes(clip.subtract(under));        if (!holes.isEmpty()) {            clearWithOpenGL(holes, 0, 0, 0, 1);        }        return;    }    if (!isProtected()) {        glBindTexture(GL_TEXTURE_EXTERNAL_OES, mTextureName);        GLenum filter = GL_NEAREST;        if (getFiltering() || needsFiltering() || isFixedSize() || isCropped()) {            // TODO: we could be more subtle with isFixedSize()            filter = GL_LINEAR;        }        glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MAG_FILTER, filter);        glTexParameterx(GL_TEXTURE_EXTERNAL_OES, GL_TEXTURE_MIN_FILTER, filter);        glMatrixMode(GL_TEXTURE);        glLoadMatrixf(mTextureMatrix);        glMatrixMode(GL_MODELVIEW);        glDisable(GL_TEXTURE_2D);        glEnable(GL_TEXTURE_EXTERNAL_OES);    } else {        glBindTexture(GL_TEXTURE_2D, mFlinger->getProtectedTexName());        glMatrixMode(GL_TEXTURE);        glLoadIdentity();        glMatrixMode(GL_MODELVIEW);        glDisable(GL_TEXTURE_EXTERNAL_OES);        glEnable(GL_TEXTURE_2D);    }    drawWithOpenGL(clip);    glDisable(GL_TEXTURE_EXTERNAL_OES);    glDisable(GL_TEXTURE_2D);}
开发者ID:AOKP-PASSION,项目名称:frameworks_base_ics,代码行数:58,


示例22: availableToRead

ssize_t MonoPipeReader::availableToRead(){    if (CC_UNLIKELY(!mNegotiated)) {        return NEGOTIATE;    }    ssize_t ret = android_atomic_acquire_load(&mPipe->mRear) - mPipe->mFront;    ALOG_ASSERT((0 <= ret) && (ret <= mPipe->mMaxFrames));    return ret;}
开发者ID:AOSB,项目名称:android_frameworks_av,代码行数:9,


示例23: onGLContextDestroyed

void GpuMemoryTracker::onGLContextDestroyed() {    gGpuThread = 0;    if (CC_UNLIKELY(gObjectSet.size() > 0)) {        std::stringstream os;        dump(os);        ALOGE("%s", os.str().c_str());        LOG_ALWAYS_FATAL("Leaked %zd GPU objects!", gObjectSet.size());    }}
开发者ID:debian-pkg-android-tools,项目名称:android-platform-frameworks-base,代码行数:9,


示例24: TRACE_METHOD

void PicturePileLayerContent::draw(SkCanvas* canvas){    TRACE_METHOD();    android::Mutex::Autolock lock(m_drawLock);    m_picturePile.draw(canvas);    if (CC_UNLIKELY(!m_hasContent))        ALOGW("Warning: painting PicturePile without content!");}
开发者ID:0omega,项目名称:platform_external_webkit,代码行数:9,


示例25: mState

FenceTime::FenceTime(nsecs_t signalTime)  : mState(Fence::isValidTimestamp(signalTime) ? State::VALID : State::INVALID),    mFence(nullptr),    mSignalTime(signalTime) {    if (CC_UNLIKELY(mSignalTime == Fence::SIGNAL_TIME_PENDING)) {        ALOGE("Pending signal time not allowed after signal.");        mSignalTime = Fence::SIGNAL_TIME_INVALID;    }}
开发者ID:MIPS,项目名称:frameworks-native,代码行数:9,


示例26: find_camera_metadata_ro_entry

camera_metadata_ro_entry_t CameraMetadata::find(uint32_t tag) const {    status_t res;    camera_metadata_ro_entry entry;    res = find_camera_metadata_ro_entry(mBuffer, tag, &entry);    if (CC_UNLIKELY( res != OK )) {        entry.count = 0;        entry.data.u8 = NULL;    }    return entry;}
开发者ID:3dsfr3ak,项目名称:android_frameworks_av,代码行数:10,


示例27: availableToWrite

ssize_t MonoPipe::availableToWrite() const{    if (CC_UNLIKELY(!mNegotiated)) {        return NEGOTIATE;    }    // uses mMaxFrames not mReqFrames, so allows "over-filling" the pipe beyond requested limit    ssize_t ret = mMaxFrames - (mRear - android_atomic_acquire_load(&mFront));    ALOG_ASSERT((0 <= ret) && (ret <= mMaxFrames));    return ret;}
开发者ID:3dsfr3ak,项目名称:android_frameworks_av,代码行数:10,


示例28: serializeIntersectedClip

const ClipBase* Snapshot::serializeIntersectedClip(LinearAllocator& allocator,        const ClipBase* recordedClip, const Matrix4& recordedClipTransform) {    auto target = this;    if (CC_UNLIKELY(recordedClip && recordedClip->intersectWithRoot)) {        // Clip must be intersected with root, instead of current clip.        target = getClipRoot(this);    }    return target->mClipArea->serializeIntersectedClip(allocator,            recordedClip, recordedClipTransform);}
开发者ID:debian-pkg-android-tools,项目名称:android-platform-frameworks-base,代码行数:11,



注:本文中的CC_UNLIKELY函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


C++ CC_UNUSED_PARAM函数代码示例
C++ CC_SAFE_RETAIN函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。