aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrDrawTarget.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gpu/GrDrawTarget.h')
-rw-r--r--src/gpu/GrDrawTarget.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/gpu/GrDrawTarget.h b/src/gpu/GrDrawTarget.h
index b3eee852f2..b975f69797 100644
--- a/src/gpu/GrDrawTarget.h
+++ b/src/gpu/GrDrawTarget.h
@@ -627,6 +627,26 @@ public:
////////////////////////////////////////////////////////////////////////////
+ /**
+ * Constructor sets the color to be 'color' which is undone by the destructor.
+ */
+ class AutoColorRestore : public ::GrNoncopyable {
+ public:
+ AutoColorRestore(GrDrawTarget* target, GrColor color) {
+ fDrawTarget = target;
+ fOldColor = target->drawState()->getColor();
+ target->drawState()->setColor(color);
+ }
+ ~AutoColorRestore() {
+ fDrawTarget->drawState()->setColor(fOldColor);
+ }
+ private:
+ GrDrawTarget* fDrawTarget;
+ GrColor fOldColor;
+ };
+
+ ////////////////////////////////////////////////////////////////////////////
+
class AutoReleaseGeometry : ::GrNoncopyable {
public:
AutoReleaseGeometry(GrDrawTarget* target,
@@ -1023,6 +1043,7 @@ protected:
const GrMatrix* matrix,
const GrRect* srcRects[],
const GrMatrix* srcMatrices[],
+ GrColor color,
GrVertexLayout layout,
void* vertices);