diff options
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; |