| 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 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 414 bool is_root_render_pass = | 414 bool is_root_render_pass = |
| 415 frame->current_render_pass == frame->root_render_pass; | 415 frame->current_render_pass == frame->root_render_pass; |
| 416 bool has_external_stencil_test = | 416 bool has_external_stencil_test = |
| 417 is_root_render_pass && output_surface_->HasExternalStencilTest(); | 417 is_root_render_pass && output_surface_->HasExternalStencilTest(); |
| 418 bool should_clear_surface = | 418 bool should_clear_surface = |
| 419 !has_external_stencil_test && | 419 !has_external_stencil_test && |
| 420 (!is_root_render_pass || settings_->should_clear_root_render_pass); | 420 (!is_root_render_pass || settings_->should_clear_root_render_pass); |
| 421 | 421 |
| 422 // If |has_external_stencil_test| we can't discard or clear. Make sure we | 422 // If |has_external_stencil_test| we can't discard or clear. Make sure we |
| 423 // don't need to. | 423 // don't need to. |
| 424 DCHECK_IMPLIES(has_external_stencil_test, | 424 DCHECK(!has_external_stencil_test || |
| 425 !frame->current_render_pass->has_transparent_background); | 425 !frame->current_render_pass->has_transparent_background); |
| 426 | 426 |
| 427 SurfaceInitializationMode mode; | 427 SurfaceInitializationMode mode; |
| 428 if (should_clear_surface && render_pass_is_clipped) { | 428 if (should_clear_surface && render_pass_is_clipped) { |
| 429 mode = SURFACE_INITIALIZATION_MODE_SCISSORED_CLEAR; | 429 mode = SURFACE_INITIALIZATION_MODE_SCISSORED_CLEAR; |
| 430 } else if (should_clear_surface) { | 430 } else if (should_clear_surface) { |
| 431 mode = SURFACE_INITIALIZATION_MODE_FULL_SURFACE_CLEAR; | 431 mode = SURFACE_INITIALIZATION_MODE_FULL_SURFACE_CLEAR; |
| 432 } else { | 432 } else { |
| 433 mode = SURFACE_INITIALIZATION_MODE_PRESERVE; | 433 mode = SURFACE_INITIALIZATION_MODE_PRESERVE; |
| 434 } | 434 } |
| 435 | 435 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 ScopedResource* texture = render_pass_textures_.get(id); | 520 ScopedResource* texture = render_pass_textures_.get(id); |
| 521 return texture && texture->id(); | 521 return texture && texture->id(); |
| 522 } | 522 } |
| 523 | 523 |
| 524 // static | 524 // static |
| 525 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { | 525 gfx::Size DirectRenderer::RenderPassTextureSize(const RenderPass* render_pass) { |
| 526 return render_pass->output_rect.size(); | 526 return render_pass->output_rect.size(); |
| 527 } | 527 } |
| 528 | 528 |
| 529 } // namespace cc | 529 } // namespace cc |
| OLD | NEW |