OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "cc/direct_renderer.h" | 5 #include "cc/direct_renderer.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 gfx::Size size = renderPassTextureSize(renderPass); | 284 gfx::Size size = renderPassTextureSize(renderPass); |
285 size.Enlarge(m_enlargePassTextureAmount.x(), m_enlargePassTextureAmount.y())
; | 285 size.Enlarge(m_enlargePassTextureAmount.x(), m_enlargePassTextureAmount.y())
; |
286 if (!texture->id() && !texture->Allocate(size, renderPassTextureFormat(rende
rPass), ResourceProvider::TextureUsageFramebuffer)) | 286 if (!texture->id() && !texture->Allocate(size, renderPassTextureFormat(rende
rPass), ResourceProvider::TextureUsageFramebuffer)) |
287 return false; | 287 return false; |
288 | 288 |
289 return bindFramebufferToTexture(frame, texture, renderPass->output_rect); | 289 return bindFramebufferToTexture(frame, texture, renderPass->output_rect); |
290 } | 290 } |
291 | 291 |
292 bool DirectRenderer::haveCachedResourcesForRenderPassId(RenderPass::Id id) const | 292 bool DirectRenderer::haveCachedResourcesForRenderPassId(RenderPass::Id id) const |
293 { | 293 { |
| 294 if (!settings().cacheRenderPassContents) |
| 295 return false; |
| 296 |
294 CachedResource* texture = m_renderPassTextures.get(id); | 297 CachedResource* texture = m_renderPassTextures.get(id); |
295 return texture && texture->id() && texture->isComplete(); | 298 return texture && texture->id() && texture->isComplete(); |
296 } | 299 } |
297 | 300 |
298 // static | 301 // static |
299 gfx::Size DirectRenderer::renderPassTextureSize(const RenderPass* pass) | 302 gfx::Size DirectRenderer::renderPassTextureSize(const RenderPass* pass) |
300 { | 303 { |
301 return pass->output_rect.size(); | 304 return pass->output_rect.size(); |
302 } | 305 } |
303 | 306 |
304 // static | 307 // static |
305 GLenum DirectRenderer::renderPassTextureFormat(const RenderPass*) | 308 GLenum DirectRenderer::renderPassTextureFormat(const RenderPass*) |
306 { | 309 { |
307 return GL_RGBA; | 310 return GL_RGBA; |
308 } | 311 } |
309 | 312 |
310 } // namespace cc | 313 } // namespace cc |
OLD | NEW |