Index: cc/direct_renderer.cc |
diff --git a/cc/direct_renderer.cc b/cc/direct_renderer.cc |
index 0b2d74b82076e5108b3d1388d18e71a06b43677d..42be62c427ac0d485354a605e3ae89d7b6c30930 100644 |
--- a/cc/direct_renderer.cc |
+++ b/cc/direct_renderer.cc |
@@ -134,7 +134,9 @@ void DirectRenderer::decideRenderPassAllocationsForFrame(const RenderPassList& r |
CachedResource* texture = passIterator->second; |
DCHECK(texture); |
- if (texture->id() && (texture->size() != requiredSize || texture->format() != requiredFormat)) |
+ bool sizeAppropriate = texture->size().width() >= requiredSize.width() && |
+ texture->size().height() >= requiredSize.height(); |
+ if (texture->id() && (!sizeAppropriate || texture->format() != requiredFormat)) |
texture->Free(); |
} |
@@ -267,7 +269,9 @@ bool DirectRenderer::useRenderPass(DrawingFrame& frame, const RenderPass* render |
CachedResource* texture = m_renderPassTextures.get(renderPass->id); |
DCHECK(texture); |
- if (!texture->id() && !texture->Allocate(Renderer::ImplPool, renderPassTextureSize(renderPass), renderPassTextureFormat(renderPass), ResourceProvider::TextureUsageFramebuffer)) |
+ |
+ gfx::Size size = renderPassTextureSize(renderPass); |
+ if (!texture->id() && !texture->Allocate(Renderer::ImplPool, size, renderPassTextureFormat(renderPass), ResourceProvider::TextureUsageFramebuffer)) |
return false; |
return bindFramebufferToTexture(frame, texture, renderPass->output_rect); |