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/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/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
364 frame->current_render_pass == frame->root_render_pass; | 364 frame->current_render_pass == frame->root_render_pass; |
365 | 365 |
366 DiscardPixels(has_external_stencil_test, draw_rect_covers_full_surface); | 366 DiscardPixels(has_external_stencil_test, draw_rect_covers_full_surface); |
367 ClearFramebuffer(frame, has_external_stencil_test); | 367 ClearFramebuffer(frame, has_external_stencil_test); |
368 } | 368 } |
369 | 369 |
370 const QuadList& quad_list = render_pass->quad_list; | 370 const QuadList& quad_list = render_pass->quad_list; |
371 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); | 371 for (QuadList::ConstBackToFrontIterator it = quad_list.BackToFrontBegin(); |
372 it != quad_list.BackToFrontEnd(); | 372 it != quad_list.BackToFrontEnd(); |
373 ++it) { | 373 ++it) { |
374 const DrawQuad& quad = *(*it); | 374 const DrawQuad& quad = *it; |
375 bool should_skip_quad = false; | 375 bool should_skip_quad = false; |
376 | 376 |
377 if (using_scissor_as_optimization) { | 377 if (using_scissor_as_optimization) { |
378 SetScissorStateForQuadWithRenderPassScissor( | 378 SetScissorStateForQuadWithRenderPassScissor( |
379 frame, quad, render_pass_scissor, &should_skip_quad); | 379 frame, quad, render_pass_scissor, &should_skip_quad); |
380 } else { | 380 } else { |
381 SetScissorStateForQuad(frame, quad); | 381 SetScissorStateForQuad(frame, quad); |
382 } | 382 } |
383 | 383 |
384 if (!should_skip_quad) | 384 if (!should_skip_quad) |
385 DoDrawQuad(frame, *it); | 385 DoDrawQuad(frame, &*it); |
danakj
2014/09/23 17:59:38
nit: &quad?
weiliangc
2014/09/24 20:14:35
Done.
| |
386 } | 386 } |
387 FinishDrawingQuadList(); | 387 FinishDrawingQuadList(); |
388 } | 388 } |
389 | 389 |
390 bool DirectRenderer::UseRenderPass(DrawingFrame* frame, | 390 bool DirectRenderer::UseRenderPass(DrawingFrame* frame, |
391 const RenderPass* render_pass) { | 391 const RenderPass* render_pass) { |
392 frame->current_render_pass = render_pass; | 392 frame->current_render_pass = render_pass; |
393 frame->current_texture = NULL; | 393 frame->current_texture = NULL; |
394 | 394 |
395 if (render_pass == frame->root_render_pass) { | 395 if (render_pass == frame->root_render_pass) { |
(...skipping 23 matching lines...) Expand all Loading... | |
419 ScopedResource* texture = render_pass_textures_.get(id); | 419 ScopedResource* texture = render_pass_textures_.get(id); |
420 return texture && texture->id(); | 420 return texture && texture->id(); |
421 } | 421 } |
422 | 422 |
423 // static | 423 // static |
424 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 424 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
425 return render_pass->output_rect.size(); | 425 return render_pass->output_rect.size(); |
426 } | 426 } |
427 | 427 |
428 } // namespace cc | 428 } // namespace cc |
OLD | NEW |