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) { |