| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/layers/render_surface_impl.h" | 5 #include "cc/layers/render_surface_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "base/strings/stringprintf.h" | 12 #include "base/strings/stringprintf.h" |
| 13 #include "cc/base/math_util.h" | 13 #include "cc/base/math_util.h" |
| 14 #include "cc/debug/debug_colors.h" | 14 #include "cc/debug/debug_colors.h" |
| 15 #include "cc/layers/layer_impl.h" | 15 #include "cc/layers/layer_impl.h" |
| 16 #include "cc/layers/render_pass_sink.h" | |
| 17 #include "cc/output/filter_operations.h" | 16 #include "cc/output/filter_operations.h" |
| 18 #include "cc/quads/debug_border_draw_quad.h" | 17 #include "cc/quads/debug_border_draw_quad.h" |
| 19 #include "cc/quads/render_pass.h" | 18 #include "cc/quads/render_pass.h" |
| 20 #include "cc/quads/render_pass_draw_quad.h" | 19 #include "cc/quads/render_pass_draw_quad.h" |
| 21 #include "cc/quads/shared_quad_state.h" | 20 #include "cc/quads/shared_quad_state.h" |
| 22 #include "cc/trees/damage_tracker.h" | 21 #include "cc/trees/damage_tracker.h" |
| 23 #include "cc/trees/draw_property_utils.h" | 22 #include "cc/trees/draw_property_utils.h" |
| 24 #include "cc/trees/effect_node.h" | 23 #include "cc/trees/effect_node.h" |
| 25 #include "cc/trees/layer_tree_impl.h" | 24 #include "cc/trees/layer_tree_impl.h" |
| 26 #include "cc/trees/occlusion.h" | 25 #include "cc/trees/occlusion.h" |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 } | 349 } |
| 351 | 350 |
| 352 void RenderSurfaceImpl::ClearLayerLists() { | 351 void RenderSurfaceImpl::ClearLayerLists() { |
| 353 layer_list_.clear(); | 352 layer_list_.clear(); |
| 354 } | 353 } |
| 355 | 354 |
| 356 int RenderSurfaceImpl::GetRenderPassId() { | 355 int RenderSurfaceImpl::GetRenderPassId() { |
| 357 return id(); | 356 return id(); |
| 358 } | 357 } |
| 359 | 358 |
| 360 void RenderSurfaceImpl::AppendRenderPasses(RenderPassSink* pass_sink) { | 359 std::unique_ptr<RenderPass> RenderSurfaceImpl::CreateRenderPass() { |
| 361 std::unique_ptr<RenderPass> pass = RenderPass::Create(layer_list_.size()); | 360 std::unique_ptr<RenderPass> pass = RenderPass::Create(layer_list_.size()); |
| 362 gfx::Rect damage_rect = GetDamageRect(); | 361 gfx::Rect damage_rect = GetDamageRect(); |
| 363 damage_rect.Intersect(content_rect()); | 362 damage_rect.Intersect(content_rect()); |
| 364 pass->SetNew(id(), content_rect(), damage_rect, | 363 pass->SetNew(id(), content_rect(), damage_rect, |
| 365 draw_properties_.screen_space_transform); | 364 draw_properties_.screen_space_transform); |
| 366 pass->filters = Filters(); | 365 pass->filters = Filters(); |
| 367 pass->background_filters = BackgroundFilters(); | 366 pass->background_filters = BackgroundFilters(); |
| 368 pass_sink->AppendRenderPass(std::move(pass)); | 367 return pass; |
| 369 } | 368 } |
| 370 | 369 |
| 371 void RenderSurfaceImpl::AppendQuads(RenderPass* render_pass, | 370 void RenderSurfaceImpl::AppendQuads(RenderPass* render_pass, |
| 372 AppendQuadsData* append_quads_data) { | 371 AppendQuadsData* append_quads_data) { |
| 373 gfx::Rect visible_layer_rect = | 372 gfx::Rect visible_layer_rect = |
| 374 occlusion_in_content_space().GetUnoccludedContentRect(content_rect()); | 373 occlusion_in_content_space().GetUnoccludedContentRect(content_rect()); |
| 375 if (visible_layer_rect.IsEmpty()) | 374 if (visible_layer_rect.IsEmpty()) |
| 376 return; | 375 return; |
| 377 | 376 |
| 378 const PropertyTrees* property_trees = layer_tree_impl_->property_trees(); | 377 const PropertyTrees* property_trees = layer_tree_impl_->property_trees(); |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 419 RenderPassDrawQuad* quad = | 418 RenderPassDrawQuad* quad = |
| 420 render_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); | 419 render_pass->CreateAndAppendDrawQuad<RenderPassDrawQuad>(); |
| 421 quad->SetNew( | 420 quad->SetNew( |
| 422 shared_quad_state, content_rect(), visible_layer_rect, GetRenderPassId(), | 421 shared_quad_state, content_rect(), visible_layer_rect, GetRenderPassId(), |
| 423 mask_resource_id, gfx::ScaleRect(gfx::RectF(content_rect()), | 422 mask_resource_id, gfx::ScaleRect(gfx::RectF(content_rect()), |
| 424 mask_uv_scale.x(), mask_uv_scale.y()), | 423 mask_uv_scale.x(), mask_uv_scale.y()), |
| 425 mask_texture_size, surface_contents_scale, FiltersOrigin(), gfx::RectF()); | 424 mask_texture_size, surface_contents_scale, FiltersOrigin(), gfx::RectF()); |
| 426 } | 425 } |
| 427 | 426 |
| 428 } // namespace cc | 427 } // namespace cc |
| OLD | NEW |