Index: src/gpu/gl/GrGLGpu.h |
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h |
index 3fe42048078c456f971f5b84aa0562b885ffffff..62803ee84c943eb378bbbfbac0b72a506ff66ddf 100644 |
--- a/src/gpu/gl/GrGLGpu.h |
+++ b/src/gpu/gl/GrGLGpu.h |
@@ -18,6 +18,7 @@ |
#include "GrGLVertexArray.h" |
#include "GrGpu.h" |
#include "GrTypes.h" |
+#include "GrWindowRectsState.h" |
#include "GrXferProcessor.h" |
#include "SkTArray.h" |
#include "SkTypes.h" |
@@ -314,7 +315,7 @@ private: |
// disables the scissor |
void disableScissor(); |
- void flushWindowRectangles(const GrWindowRectangles&, const GrGLRenderTarget*); |
+ void flushWindowRectangles(const GrWindowRectsState&, const GrGLRenderTarget*); |
void disableWindowRectangles(); |
void initFSAASupport(); |
@@ -424,39 +425,36 @@ private: |
class { |
public: |
- bool valid() const { return kInvalidOrigin != fOrigin; } |
- void invalidate() { fOrigin = kInvalidOrigin; } |
- |
- bool disabled() const { |
- return this->valid() && Mode::kExclusive == fWindows.mode() && !fWindows.count(); |
+ bool valid() const { return kInvalidSurfaceOrigin != fRTOrigin; } |
+ void invalidate() { fRTOrigin = kInvalidSurfaceOrigin; } |
+ bool knownDisabled() const { return this->valid() && !fWindowState.enabled(); } |
+ void setDisabled() { fRTOrigin = kDefault_GrSurfaceOrigin, fWindowState.setDisabled(); } |
+ |
+ void set(GrSurfaceOrigin rtOrigin, const GrGLIRect& viewport, |
+ const GrWindowRectsState& windowState) { |
+ fRTOrigin = rtOrigin; |
+ fViewport = viewport; |
+ fWindowState = windowState; |
} |
- void setDisabled() { fOrigin = kDefault_GrSurfaceOrigin, fWindows.reset(); } |
- bool equal(GrSurfaceOrigin org, const GrGLIRect& viewp, |
- const GrWindowRectangles& windows) const { |
+ bool knownEqualTo(GrSurfaceOrigin rtOrigin, const GrGLIRect& viewport, |
+ const GrWindowRectsState& windowState) const { |
if (!this->valid()) { |
return false; |
} |
- if (fWindows.count() && (fOrigin != org || fViewport != viewp)) { |
+ if (fWindowState.numWindows() && (fRTOrigin != rtOrigin || fViewport != viewport)) { |
return false; |
} |
- return fWindows == windows; |
- } |
- |
- void set(GrSurfaceOrigin org, const GrGLIRect& viewp, const GrWindowRectangles& windows) { |
- fOrigin = org; |
- fViewport = viewp; |
- fWindows = windows; |
+ return fWindowState.cheapEqualTo(windowState); |
} |
private: |
- typedef GrWindowRectangles::Mode Mode; |
- enum { kInvalidOrigin = -1 }; |
+ enum { kInvalidSurfaceOrigin = -1 }; |
- int fOrigin; |
+ int fRTOrigin; |
GrGLIRect fViewport; |
- GrWindowRectangles fWindows; |
- } fHWWindowRects; |
+ GrWindowRectsState fWindowState; |
+ } fHWWindowRectsState; |
GrGLIRect fHWViewport; |