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

Side by Side Diff: cc/output/direct_renderer.cc

Issue 14417014: cc: Add tile-free software compositing mode. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to 199251 Created 7 years, 7 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 | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/output/output_surface.h » ('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/output/direct_renderer.h" 5 #include "cc/output/direct_renderer.h"
6 6
7 #include <utility> 7 #include <utility>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/debug/trace_event.h" 10 #include "base/debug/trace_event.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 126
127 DirectRenderer::~DirectRenderer() {} 127 DirectRenderer::~DirectRenderer() {}
128 128
129 void DirectRenderer::SetEnlargePassTextureAmountForTesting( 129 void DirectRenderer::SetEnlargePassTextureAmountForTesting(
130 gfx::Vector2d amount) { 130 gfx::Vector2d amount) {
131 enlarge_pass_texture_amount_ = amount; 131 enlarge_pass_texture_amount_ = amount;
132 } 132 }
133 133
134 void DirectRenderer::DecideRenderPassAllocationsForFrame( 134 void DirectRenderer::DecideRenderPassAllocationsForFrame(
135 const RenderPassList& render_passes_in_draw_order) { 135 const RenderPassList& render_passes_in_draw_order) {
136 if (!resource_provider_)
137 return;
138
136 base::hash_map<RenderPass::Id, const RenderPass*> render_passes_in_frame; 139 base::hash_map<RenderPass::Id, const RenderPass*> render_passes_in_frame;
137 for (size_t i = 0; i < render_passes_in_draw_order.size(); ++i) 140 for (size_t i = 0; i < render_passes_in_draw_order.size(); ++i)
138 render_passes_in_frame.insert(std::pair<RenderPass::Id, const RenderPass*>( 141 render_passes_in_frame.insert(std::pair<RenderPass::Id, const RenderPass*>(
139 render_passes_in_draw_order[i]->id, render_passes_in_draw_order[i])); 142 render_passes_in_draw_order[i]->id, render_passes_in_draw_order[i]));
140 143
141 std::vector<RenderPass::Id> passes_to_delete; 144 std::vector<RenderPass::Id> passes_to_delete;
142 ScopedPtrHashMap<RenderPass::Id, CachedResource>::const_iterator pass_iter; 145 ScopedPtrHashMap<RenderPass::Id, CachedResource>::const_iterator pass_iter;
143 for (pass_iter = render_pass_textures_.begin(); 146 for (pass_iter = render_pass_textures_.begin();
144 pass_iter != render_pass_textures_.end(); 147 pass_iter != render_pass_textures_.end();
145 ++pass_iter) { 148 ++pass_iter) {
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 frame->current_render_pass = render_pass; 319 frame->current_render_pass = render_pass;
317 frame->current_texture = NULL; 320 frame->current_texture = NULL;
318 321
319 if (render_pass == frame->root_render_pass) { 322 if (render_pass == frame->root_render_pass) {
320 BindFramebufferToOutputSurface(frame); 323 BindFramebufferToOutputSurface(frame);
321 InitializeMatrices(frame, render_pass->output_rect, FlippedFramebuffer()); 324 InitializeMatrices(frame, render_pass->output_rect, FlippedFramebuffer());
322 SetDrawViewportSize(render_pass->output_rect.size()); 325 SetDrawViewportSize(render_pass->output_rect.size());
323 return true; 326 return true;
324 } 327 }
325 328
329 if (!resource_provider_)
330 return false;
331
326 CachedResource* texture = render_pass_textures_.get(render_pass->id); 332 CachedResource* texture = render_pass_textures_.get(render_pass->id);
327 DCHECK(texture); 333 DCHECK(texture);
328 334
329 gfx::Size size = RenderPassTextureSize(render_pass); 335 gfx::Size size = RenderPassTextureSize(render_pass);
330 size.Enlarge(enlarge_pass_texture_amount_.x(), 336 size.Enlarge(enlarge_pass_texture_amount_.x(),
331 enlarge_pass_texture_amount_.y()); 337 enlarge_pass_texture_amount_.y());
332 if (!texture->id() && 338 if (!texture->id() &&
333 !texture->Allocate(size, 339 !texture->Allocate(size,
334 RenderPassTextureFormat(render_pass), 340 RenderPassTextureFormat(render_pass),
335 ResourceProvider::TextureUsageFramebuffer)) 341 ResourceProvider::TextureUsageFramebuffer))
(...skipping 15 matching lines...) Expand all
351 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { 357 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) {
352 return render_pass->output_rect.size(); 358 return render_pass->output_rect.size();
353 } 359 }
354 360
355 // static 361 // static
356 GLenum DirectRenderer::RenderPassTextureFormat(const RenderPass* render_pass) { 362 GLenum DirectRenderer::RenderPassTextureFormat(const RenderPass* render_pass) {
357 return GL_RGBA; 363 return GL_RGBA;
358 } 364 }
359 365
360 } // namespace cc 366 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl_unittest.cc ('k') | cc/output/output_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698