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

Unified Diff: src/gpu/gl/GrGLGpu.h

Issue 2289363005: Improve usage of window rectangles (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_drawsinreducedclip
Patch Set: Improve usage of window rectangles Created 4 years, 3 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 | « src/gpu/batches/GrClearBatch.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « src/gpu/batches/GrClearBatch.h ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698