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

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

Issue 2312173002: Revert of Improve usage of window rectangles (Closed) Base URL: https://skia.googlesource.com/skia.git@upload_drawsinreducedclip
Patch Set: 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 62803ee84c943eb378bbbfbac0b72a506ff66ddf..3fe42048078c456f971f5b84aa0562b885ffffff 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -18,7 +18,6 @@
#include "GrGLVertexArray.h"
#include "GrGpu.h"
#include "GrTypes.h"
-#include "GrWindowRectsState.h"
#include "GrXferProcessor.h"
#include "SkTArray.h"
#include "SkTypes.h"
@@ -315,7 +314,7 @@
// disables the scissor
void disableScissor();
- void flushWindowRectangles(const GrWindowRectsState&, const GrGLRenderTarget*);
+ void flushWindowRectangles(const GrWindowRectangles&, const GrGLRenderTarget*);
void disableWindowRectangles();
void initFSAASupport();
@@ -425,36 +424,39 @@
class {
public:
- 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;
- }
-
- bool knownEqualTo(GrSurfaceOrigin rtOrigin, const GrGLIRect& viewport,
- const GrWindowRectsState& windowState) const {
+ bool valid() const { return kInvalidOrigin != fOrigin; }
+ void invalidate() { fOrigin = kInvalidOrigin; }
+
+ bool disabled() const {
+ return this->valid() && Mode::kExclusive == fWindows.mode() && !fWindows.count();
+ }
+ void setDisabled() { fOrigin = kDefault_GrSurfaceOrigin, fWindows.reset(); }
+
+ bool equal(GrSurfaceOrigin org, const GrGLIRect& viewp,
+ const GrWindowRectangles& windows) const {
if (!this->valid()) {
return false;
}
- if (fWindowState.numWindows() && (fRTOrigin != rtOrigin || fViewport != viewport)) {
+ if (fWindows.count() && (fOrigin != org || fViewport != viewp)) {
return false;
}
- return fWindowState.cheapEqualTo(windowState);
+ return fWindows == windows;
+ }
+
+ void set(GrSurfaceOrigin org, const GrGLIRect& viewp, const GrWindowRectangles& windows) {
+ fOrigin = org;
+ fViewport = viewp;
+ fWindows = windows;
}
private:
- enum { kInvalidSurfaceOrigin = -1 };
-
- int fRTOrigin;
+ typedef GrWindowRectangles::Mode Mode;
+ enum { kInvalidOrigin = -1 };
+
+ int fOrigin;
GrGLIRect fViewport;
- GrWindowRectsState fWindowState;
- } fHWWindowRectsState;
+ GrWindowRectangles fWindows;
+ } fHWWindowRects;
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