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

Side by Side Diff: cc/direct_renderer.cc

Issue 12210077: cc: Disable RenderSurface caching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RebasedTOHead Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « no previous file | cc/layer_tree_host_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698