Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(20)

Unified Diff: include/gpu/GrSurface.h

Issue 22558003: Add blend optimization helpers and use to convert rect draws to clears. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: suppress warning Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/gpu/GrPaint.h ('k') | src/gpu/GrBlend.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: include/gpu/GrSurface.h
diff --git a/include/gpu/GrSurface.h b/include/gpu/GrSurface.h
index 52a56659ab11012dd4819f7bdf70eacdd9a51d94..eeb63ad21bfd7f85d125430fb66b25360e6b36b7 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;
« no previous file with comments | « include/gpu/GrPaint.h ('k') | src/gpu/GrBlend.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698