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

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

Issue 2112693003: Remove support for GL discards (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 6 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/gl/GrGLGpuCommandBuffer.h » ('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 b6add43b2398bd110164f66ccf3f2d956a8b068b..5b24d8a3829d9cfc8993817cab5a8b82bcf6b665 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -2176,55 +2176,6 @@ void GrGLGpu::clear(const SkIRect& rect, GrColor color, GrRenderTarget* target)
GL_CALL(Clear(GR_GL_COLOR_BUFFER_BIT));
}
-void GrGLGpu::discard(GrRenderTarget* renderTarget) {
- SkASSERT(renderTarget);
- if (!this->caps()->discardRenderTargetSupport()) {
- return;
- }
-
- GrGLRenderTarget* glRT = static_cast<GrGLRenderTarget*>(renderTarget);
- if (renderTarget->getUniqueID() != fHWBoundRenderTargetUniqueID) {
- fHWBoundRenderTargetUniqueID = SK_InvalidUniqueID;
- fStats.incRenderTargetBinds();
- GL_CALL(BindFramebuffer(GR_GL_FRAMEBUFFER, glRT->renderFBOID()));
- }
- switch (this->glCaps().invalidateFBType()) {
- case GrGLCaps::kNone_InvalidateFBType:
- SkFAIL("Should never get here.");
- break;
- case GrGLCaps::kInvalidate_InvalidateFBType:
- if (0 == glRT->renderFBOID()) {
- // When rendering to the default framebuffer the legal values for attachments
- // are GL_COLOR, GL_DEPTH, GL_STENCIL, ... rather than the various FBO attachment
- // types.
- static const GrGLenum attachments[] = { GR_GL_COLOR };
- GL_CALL(InvalidateFramebuffer(GR_GL_FRAMEBUFFER, SK_ARRAY_COUNT(attachments),
- attachments));
- } else {
- static const GrGLenum attachments[] = { GR_GL_COLOR_ATTACHMENT0 };
- GL_CALL(InvalidateFramebuffer(GR_GL_FRAMEBUFFER, SK_ARRAY_COUNT(attachments),
- attachments));
- }
- break;
- case GrGLCaps::kDiscard_InvalidateFBType: {
- if (0 == glRT->renderFBOID()) {
- // When rendering to the default framebuffer the legal values for attachments
- // are GL_COLOR, GL_DEPTH, GL_STENCIL, ... rather than the various FBO attachment
- // types. See glDiscardFramebuffer() spec.
- static const GrGLenum attachments[] = { GR_GL_COLOR };
- GL_CALL(DiscardFramebuffer(GR_GL_FRAMEBUFFER, SK_ARRAY_COUNT(attachments),
- attachments));
- } else {
- static const GrGLenum attachments[] = { GR_GL_COLOR_ATTACHMENT0 };
- GL_CALL(DiscardFramebuffer(GR_GL_FRAMEBUFFER, SK_ARRAY_COUNT(attachments),
- attachments));
- }
- break;
- }
- }
- renderTarget->flagAsResolved();
-}
-
void GrGLGpu::clearStencil(GrRenderTarget* target) {
if (nullptr == target) {
return;
« no previous file with comments | « src/gpu/gl/GrGLGpu.h ('k') | src/gpu/gl/GrGLGpuCommandBuffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698