sp<GraphicBuffer> mPostedBuffer;
bool mConnectedToCpu;
- // In the lock/unlock context, this reflects the region that the producer
- // wished to update and whether the Surface was able to copy the previous
- // buffer back to allow a partial update.
+ // When a CPU producer is attached, this reflects the region that the
+ // producer wished to update as well as whether the Surface was able to copy
+ // the previous buffer back to allow a partial update.
//
- // In the dequeue/queue context, this reflects the surface damage (the
- // damage since the last frame) passed in by the producer.
+ // When a non-CPU producer is attached, this reflects the surface damage
+ // (the change since the previous frame) passed in by the producer.
Region mDirtyRegion;
};
mDataSpace, crop, mScalingMode, mTransform ^ mStickyTransform,
mSwapIntervalZero, fence, mStickyTransform);
- if (mDirtyRegion.bounds() == Rect::INVALID_RECT) {
+ if (mConnectedToCpu || mDirtyRegion.bounds() == Rect::INVALID_RECT) {
input.setSurfaceDamage(Region::INVALID_REGION);
} else {
// The surface damage was specified using the OpenGL ES convention of
mConsumerRunningBehind = (numPendingBuffers >= 2);
- // Clear surface damage back to full-buffer
- mDirtyRegion = Region::INVALID_REGION;
+ if (!mConnectedToCpu) {
+ // Clear surface damage back to full-buffer
+ mDirtyRegion = Region::INVALID_REGION;
+ }
return err;
}
ALOGV("Surface::setSurfaceDamage");
Mutex::Autolock lock(mMutex);
- if (numRects == 0) {
+ if (mConnectedToCpu || numRects == 0) {
mDirtyRegion = Region::INVALID_REGION;
return;
}