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

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

Issue 2251573002: Implement difference clip rects with window rectangles (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: return type Created 4 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
Index: src/gpu/gl/GrGLGpu.h
diff --git a/src/gpu/gl/GrGLGpu.h b/src/gpu/gl/GrGLGpu.h
index 0356352529fe37aba0c6ea8892218d816114aa21..26c9588fcc3396ba78adc29a91cfb693759a72d6 100644
--- a/src/gpu/gl/GrGLGpu.h
+++ b/src/gpu/gl/GrGLGpu.h
@@ -314,6 +314,9 @@ private:
// disables the scissor
void disableScissor();
+ void flushWindowRectangles(const GrWindowRectangles&, const GrGLRenderTarget*);
+ void disableWindowRectangles();
+
void initFSAASupport();
// determines valid stencil formats
@@ -419,6 +422,42 @@ private:
}
} fHWScissorSettings;
+ class {
+ public:
+ 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 (fWindows.count() && (fOrigin != org || fViewport != viewp)) {
+ return false;
+ }
+ return fWindows == windows;
+ }
+
+ void set(GrSurfaceOrigin org, const GrGLIRect& viewp, const GrWindowRectangles& windows) {
+ fOrigin = org;
+ fViewport = viewp;
+ fWindows = windows;
+ }
+
+ private:
+ typedef GrWindowRectangles::Mode Mode;
+ enum { kInvalidOrigin = -1 };
+
+ int fOrigin;
+ GrGLIRect fViewport;
+ GrWindowRectangles fWindows;
+ } fHWWindowRects;
+
GrGLIRect fHWViewport;
/**
« src/gpu/GrCaps.cpp ('K') | « src/gpu/gl/GrGLCaps.cpp ('k') | src/gpu/gl/GrGLGpu.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698