diff options
author | 2013-08-14 21:56:37 +0000 | |
---|---|---|
committer | 2013-08-14 21:56:37 +0000 | |
commit | 24ab3b0ce50b3428f063849b6160e468f047487c (patch) | |
tree | b66480c5461ddfa1fdd6a8ccc6745697159d77ce /include/gpu/GrSurface.h | |
parent | 2865c4457040fde9a7617484b53c2e2db623c3e3 (diff) |
Add blend optimization helpers and use to convert rect draws to clears.
R=robertphillips@google.com, jvanverth@google.com
Author: bsalomon@google.com
Review URL: https://chromiumcodereview.appspot.com/22558003
git-svn-id: http://skia.googlecode.com/svn/trunk@10723 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'include/gpu/GrSurface.h')
-rw-r--r-- | include/gpu/GrSurface.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h index 52a56659ab..eeb63ad21b 100644 --- a/include/gpu/GrSurface.h +++ b/include/gpu/GrSurface.h @@ -11,6 +11,7 @@ #include "GrTypes.h" #include "GrResource.h" +#include "SkRect.h" class GrTexture; class GrRenderTarget; @@ -33,6 +34,12 @@ public: */ int height() const { return fDesc.fHeight; } + /** + * Helper that gets the width and height of the surface as a bounding rectangle. + */ + void getBoundsRect(SkRect* rect) const { rect->setWH(SkIntToScalar(this->width()), + SkIntToScalar(this->height())); } + GrSurfaceOrigin origin() const { GrAssert(kTopLeft_GrSurfaceOrigin == fDesc.fOrigin || kBottomLeft_GrSurfaceOrigin == fDesc.fOrigin); return fDesc.fOrigin; |