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

Unified Diff: cc/direct_renderer.cc

Issue 12036091: Fixes a bug when the framebuffer is cleared with invalid scissor rect (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Some more clean up. Created 7 years, 11 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 | « cc/direct_renderer.h ('k') | cc/gl_renderer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/direct_renderer.cc
diff --git a/cc/direct_renderer.cc b/cc/direct_renderer.cc
index 31f48e5f935be6f4e1fd88d49c5b8824067c417a..8ee56d1f2f5dcc71951a2d6793a5320481980ae8 100644
--- a/cc/direct_renderer.cc
+++ b/cc/direct_renderer.cc
@@ -144,6 +144,8 @@ void DirectRenderer::decideRenderPassAllocationsForFrame(const RenderPassList& r
texture->size().height() >= requiredSize.height();
if (texture->id() && (!sizeAppropriate || texture->format() != requiredFormat))
texture->Free();
+ else if (texture->size() != requiredSize)
danakj 2013/01/24 23:38:04 What happens if you texture->setIsComplete(false)
+ texture->setNeedsFullClear(true);
danakj 2013/01/24 23:23:18 Doesn't this clear the whole texture every frame o
danakj 2013/01/24 23:39:25 Before it would have reallocated a new texture of
}
// Delete RenderPass textures from the previous frame that will not be used again.
@@ -240,8 +242,16 @@ void DirectRenderer::drawRenderPass(DrawingFrame& frame, const RenderPass* rende
setScissorTestRect(moveScissorToWindowSpace(frame, renderPassScissor));
}
- if (frame.currentRenderPass != frame.rootRenderPass || m_client->shouldClearRootRenderPass())
- clearFramebuffer(frame);
+ bool isRootPass = frame.currentRenderPass == frame.rootRenderPass;
+ if (!isRootPass || m_client->shouldClearRootRenderPass()) {
+ CachedResource* texture = m_renderPassTextures.get(frame.currentRenderPass->id);
+ DCHECK(texture);
+ bool fullClear = false;
+ if (!isRootPass)
+ fullClear = texture->needsFullClear();
+ clearFramebuffer(frame, fullClear);
+ texture->setNeedsFullClear(false);
+ }
const QuadList& quadList = renderPass->quad_list;
for (QuadList::constBackToFrontIterator it = quadList.backToFrontBegin(); it != quadList.backToFrontEnd(); ++it) {
« no previous file with comments | « cc/direct_renderer.h ('k') | cc/gl_renderer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698