diff options
Diffstat (limited to 'gpu/src/GrTexture.cpp')
-rw-r--r-- | gpu/src/GrTexture.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gpu/src/GrTexture.cpp b/gpu/src/GrTexture.cpp index 1ea02a77b7..e9ec4e6342 100644 --- a/gpu/src/GrTexture.cpp +++ b/gpu/src/GrTexture.cpp @@ -28,6 +28,28 @@ bool GrRenderTarget::readPixels(int left, int top, int width, int height, config, buffer); } +void GrRenderTarget::flagAsNeedingResolve(const GrIRect* rect) { + if (kCanResolve_ResolveType == getResolveType()) { + if (NULL != rect) { + fResolveRect.growToInclude(*rect); + fResolveRect.intersectWith(0, 0, this->width(), this->height()); + } else { + fResolveRect.setLTRB(0, 0, this->width(), this->height()); + } + } +} + +void GrRenderTarget::overrideResolveRect(const GrIRect rect) { + fResolveRect = rect; + if (fResolveRect.isEmpty()) { + fResolveRect.setLargestInverted(); + } else { + if (!fResolveRect.intersectWith(0, 0, this->width(), this->height())) { + fResolveRect.setLargestInverted(); + } + } +} + bool GrTexture::readPixels(int left, int top, int width, int height, GrPixelConfig config, void* buffer) { // go through context so that all necessary flushing occurs |