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