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

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

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/gl/GrGLGpu.h ('k') | src/gpu/vk/GrVkGpuCommandBuffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLGpu.cpp
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index e002d5101bab5a114a75f5ea8d0e219989d0a675..466af6c6ab4bda73273d0361dfe8fc82b376c704 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -564,7 +564,7 @@
if (resetBits & kView_GrGLBackendState) {
fHWScissorSettings.invalidate();
- fHWWindowRectsState.invalidate();
+ fHWWindowRects.invalidate();
fHWViewport.invalidate();
}
@@ -1997,42 +1997,39 @@
this->disableScissor();
}
-void GrGLGpu::flushWindowRectangles(const GrWindowRectsState& windowState,
- const GrGLRenderTarget* rt) {
- typedef GrWindowRectsState::Mode Mode;
- SkASSERT(!windowState.enabled() || rt->renderFBOID()); // Window rects can't be used on-screen.
- SkASSERT(windowState.numWindows() <= this->caps()->maxWindowRectangles());
+void GrGLGpu::flushWindowRectangles(const GrWindowRectangles& windows, const GrGLRenderTarget* rt) {
+ typedef GrWindowRectangles::Mode Mode;
+ SkASSERT(windows.count() <= this->caps()->maxWindowRectangles());
+ SkASSERT(windows.disabled() || rt->renderFBOID()); // Window rectangles can't be used on-screen.
if (!this->caps()->maxWindowRectangles() ||
- fHWWindowRectsState.knownEqualTo(rt->origin(), rt->getViewport(), windowState)) {
+ fHWWindowRects.equal(rt->origin(), rt->getViewport(), windows)) {
return;
}
// This is purely a workaround for a spurious warning generated by gcc. Otherwise the above
// assert would be sufficient. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=5912
- int numWindows = SkTMin(windowState.numWindows(), int(GrWindowRectangles::kMaxWindows));
- SkASSERT(windowState.numWindows() == numWindows);
+ int numWindows = SkTMin(windows.count(), int(GrWindowRectangles::kMaxWindows));
+ SkASSERT(windows.count() == numWindows);
GrGLIRect glwindows[GrWindowRectangles::kMaxWindows];
- const SkIRect* skwindows = windowState.windows().data();
- int dx = -windowState.origin().x(), dy = -windowState.origin().y();
+ const SkIRect* skwindows = windows.data();
for (int i = 0; i < numWindows; ++i) {
- const SkIRect& skwindow = skwindows[i].makeOffset(dx, dy);
- glwindows[i].setRelativeTo(rt->getViewport(), skwindow, rt->origin());
- }
-
- GrGLenum glmode = (Mode::kExclusive == windowState.mode()) ? GR_GL_EXCLUSIVE : GR_GL_INCLUSIVE;
+ glwindows[i].setRelativeTo(rt->getViewport(), skwindows[i], rt->origin());
+ }
+
+ GrGLenum glmode = (Mode::kExclusive == windows.mode()) ? GR_GL_EXCLUSIVE : GR_GL_INCLUSIVE;
GL_CALL(WindowRectangles(glmode, numWindows, glwindows->asInts()));
- fHWWindowRectsState.set(rt->origin(), rt->getViewport(), windowState);
+ fHWWindowRects.set(rt->origin(), rt->getViewport(), windows);
}
void GrGLGpu::disableWindowRectangles() {
- if (!this->caps()->maxWindowRectangles() || fHWWindowRectsState.knownDisabled()) {
+ if (!this->caps()->maxWindowRectangles() || fHWWindowRects.disabled()) {
return;
}
GL_CALL(WindowRectangles(GR_GL_EXCLUSIVE, 0, nullptr));
- fHWWindowRectsState.setDisabled();
+ fHWWindowRects.setDisabled();
}
void GrGLGpu::flushMinSampleShading(float minSampleShading) {
@@ -2082,7 +2079,7 @@
GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(pipeline.getRenderTarget());
this->flushStencil(pipeline.getStencil());
this->flushScissor(pipeline.getScissorState(), glRT->getViewport(), glRT->origin());
- this->flushWindowRectangles(pipeline.getWindowRectsState(), glRT);
+ this->flushWindowRectangles(pipeline.getWindowRectangles(), glRT);
this->flushHWAAState(glRT, pipeline.isHWAntialiasState(), !pipeline.getStencil().isDisabled());
// This must come after textures are flushed because a texture may need
@@ -2210,7 +2207,7 @@
this->flushRenderTarget(glRT, clip.scissorEnabled() ? &clip.scissorRect() : nullptr);
this->flushScissor(clip.scissorState(), glRT->getViewport(), glRT->origin());
- this->flushWindowRectangles(clip.windowRectsState(), glRT);
+ this->disableWindowRectangles();
GrGLfloat r, g, b, a;
static const GrGLfloat scale255 = 1.f / 255.f;
@@ -2274,7 +2271,7 @@
this->flushRenderTarget(glRT, &SkIRect::EmptyIRect());
this->flushScissor(clip.scissorState(), glRT->getViewport(), glRT->origin());
- this->flushWindowRectangles(clip.windowRectsState(), glRT);
+ this->disableWindowRectangles();
GL_CALL(StencilMask((uint32_t) clipStencilMask));
GL_CALL(ClearStencil(value));
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/vk/GrVkGpuCommandBuffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698