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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 bool is_root_render_pass = | 429 bool is_root_render_pass = |
430 frame->current_render_pass == frame->root_render_pass; | 430 frame->current_render_pass == frame->root_render_pass; |
431 bool has_external_stencil_test = | 431 bool has_external_stencil_test = |
432 is_root_render_pass && output_surface_->HasExternalStencilTest(); | 432 is_root_render_pass && output_surface_->HasExternalStencilTest(); |
433 bool should_clear_surface = | 433 bool should_clear_surface = |
434 !has_external_stencil_test && | 434 !has_external_stencil_test && |
435 (!is_root_render_pass || settings_->should_clear_root_render_pass); | 435 (!is_root_render_pass || settings_->should_clear_root_render_pass); |
436 | 436 |
437 // If |has_external_stencil_test| we can't discard or clear. Make sure we | 437 // If |has_external_stencil_test| we can't discard or clear. Make sure we |
438 // don't need to. | 438 // don't need to. |
439 DCHECK(!has_external_stencil_test || | 439 DCHECK_IMPLIES(has_external_stencil_test, |
440 !frame->current_render_pass->has_transparent_background); | 440 !frame->current_render_pass->has_transparent_background); |
441 | 441 |
442 SurfaceInitializationMode mode; | 442 SurfaceInitializationMode mode; |
443 if (should_clear_surface && render_pass_is_clipped) { | 443 if (should_clear_surface && render_pass_is_clipped) { |
444 mode = SURFACE_INITIALIZATION_MODE_SCISSORED_CLEAR; | 444 mode = SURFACE_INITIALIZATION_MODE_SCISSORED_CLEAR; |
445 } else if (should_clear_surface) { | 445 } else if (should_clear_surface) { |
446 mode = SURFACE_INITIALIZATION_MODE_FULL_SURFACE_CLEAR; | 446 mode = SURFACE_INITIALIZATION_MODE_FULL_SURFACE_CLEAR; |
447 } else { | 447 } else { |
448 mode = SURFACE_INITIALIZATION_MODE_PRESERVE; | 448 mode = SURFACE_INITIALIZATION_MODE_PRESERVE; |
449 } | 449 } |
450 | 450 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
535 ScopedResource* texture = render_pass_textures_.get(id); | 535 ScopedResource* texture = render_pass_textures_.get(id); |
536 return texture && texture->id(); | 536 return texture && texture->id(); |
537 } | 537 } |
538 | 538 |
539 // static | 539 // static |
540 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 540 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
541 return render_pass->output_rect.size(); | 541 return render_pass->output_rect.size(); |
542 } | 542 } |
543 | 543 |
544 } // namespace cc | 544 } // namespace cc |
OLD | NEW |