Lines Matching refs:state

70     virtual void add(DrawOp* op, const DeferredDisplayState* state, bool opaqueOverBounds) {
72 mBounds.unionWith(state->mBounds);
74 mOps.add(OpStatePair(op, state));
81 if (rect.intersects(mOps[i].state->mBounds)) {
84 mOps[i].state->mBounds.left, mOps[i].state->mBounds.top,
85 mOps[i].state->mBounds.right, mOps[i].state->mBounds.bottom);
102 const DeferredDisplayState* state = mOps[i].state;
103 renderer.restoreDisplayState(*state);
112 const Rect& bounds = state->mBounds;
131 const Rect &r = mOps[i].state->mBounds;
184 bool canMergeWith(const DrawOp* op, const DeferredDisplayState* state) {
191 if (intersects(state->mBounds)) return false;
193 const DeferredDisplayState* lhs = state;
194 const DeferredDisplayState* rhs = mOps[0].state;
198 // Identical round rect clip state means both ops will clip in the same way, or not at all.
199 // As the state objects are const, we can compare their pointers to determine mergeability
208 const int newFlags = state->mClipSideFlags;
210 const Rect& opBounds = state->mBounds;
261 virtual void add(DrawOp* op, const DeferredDisplayState* state, bool opaqueOverBounds) {
262 DrawBatch::add(op, state, opaqueOverBounds);
264 const int newClipSideFlags = state->mClipSideFlags;
266 if (newClipSideFlags & kClipSide_Left) mClipRect.left = state->mClip.left;
267 if (newClipSideFlags & kClipSide_Top) mClipRect.top = state->mClip.top;
268 if (newClipSideFlags & kClipSide_Right) mClipRect.right = state->mClip.right;
269 if (newClipSideFlags & kClipSide_Bottom) mClipRect.bottom = state->mClip.bottom;
314 StateOpBatch(const StateOp* op, const DeferredDisplayState* state) : mOp(op), mState(state) {}
317 DEFER_LOGD("replaying state op batch %p", this);
335 RestoreToCountBatch(const StateOp* op, const DeferredDisplayState* state, int restoreCount) :
336 mOp(op), mState(state), mRestoreCount(restoreCount) {}
347 // we use the state storage for the RestoreToCountOp, but don't replay the op itself
416 * the clip from deferred state, we play back all of the relevant state operations that generated
502 DeferredDisplayState* const state = createState();
503 if (op->getLocalBounds(state->mBounds)) {
504 if (state->mBounds.isEmpty()) {
506 tryRecycleState(state);
510 state->mBounds.setEmpty();
513 /* 2: renderer calculates global bounds + stores state */
514 if (renderer.storeDisplayState(*state, getDrawOpDeferFlags())) {
515 tryRecycleState(state);
519 /* 3: ask op for defer info, given renderer state */
521 op->onDefer(renderer, deferInfo, *state);
523 // complex clip has a complex set of expectations on the renderer state - for now, avoid taking
529 state->mClipSideFlags != kClipSide_ConservativeFull &&
530 deferInfo.opaqueOverBounds && state->mBounds.contains(mBounds)) {
531 // avoid overdraw by resetting drawing state + discarding drawing ops
539 b->add(op, state, deferInfo.opaqueOverBounds);
551 if (state->mBounds.isEmpty()) {
554 b->add(op, state, deferInfo.opaqueOverBounds);
567 if (!((MergingDrawBatch*) targetBatch)->canMergeWith(op, state)) {
590 if (overBatch->intersects(state->mBounds)) {
622 targetBatch->add(op, state, deferInfo.opaqueOverBounds);
626 DEFER_LOGD("%p adding state op barrier at pos %d", this, mBatches.size());
628 DeferredDisplayState* state = createState();
629 renderer.storeDisplayState(*state, getStateOpDeferFlags());
630 mBatches.add(new StateOpBatch(op, state));
641 DeferredDisplayState* state = createState();
642 renderer.storeDisplayState(*state, getStateOpDeferFlags());
643 mBatches.add(new RestoreToCountBatch(op, state, newSaveCount));
676 // save and restore (with draw modifiers) so that reordering doesn't affect final state
701 // leave deferred state ops alone for simplicity (empty save restore pairs may now exist)