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/layers/delegated_renderer_layer_impl.h" | 5 #include "cc/layers/delegated_renderer_layer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
429 } | 429 } |
430 output_shared_quad_state->clip_rect = clip_rect; | 430 output_shared_quad_state->clip_rect = clip_rect; |
431 output_shared_quad_state->is_clipped = true; | 431 output_shared_quad_state->is_clipped = true; |
432 } | 432 } |
433 | 433 |
434 output_shared_quad_state->opacity *= draw_opacity(); | 434 output_shared_quad_state->opacity *= draw_opacity(); |
435 } | 435 } |
436 } | 436 } |
437 DCHECK(output_shared_quad_state); | 437 DCHECK(output_shared_quad_state); |
438 | 438 |
439 gfx::Transform quad_content_to_delegated_target_space = | |
440 output_shared_quad_state->content_to_target_transform; | |
441 quad_content_to_delegated_target_space.ConcatTransform( | |
danakj
2014/08/08 13:45:05
to avoid these matrix mults in most cases, can you
hartmanng
2014/08/08 14:00:02
Done.
| |
442 render_pass->transform_to_root_target); | |
443 quad_content_to_delegated_target_space.ConcatTransform(draw_transform()); | |
444 | |
439 gfx::Rect quad_visible_rect = occlusion_tracker.UnoccludedContentRect( | 445 gfx::Rect quad_visible_rect = occlusion_tracker.UnoccludedContentRect( |
440 delegated_quad->visible_rect, | 446 delegated_quad->visible_rect, quad_content_to_delegated_target_space); |
441 output_shared_quad_state->content_to_target_transform); | 447 |
442 if (quad_visible_rect.IsEmpty()) | 448 if (quad_visible_rect.IsEmpty()) |
443 continue; | 449 continue; |
444 | 450 |
445 if (delegated_quad->material != DrawQuad::RENDER_PASS) { | 451 if (delegated_quad->material != DrawQuad::RENDER_PASS) { |
446 DrawQuad* output_quad = render_pass->CopyFromAndAppendDrawQuad( | 452 DrawQuad* output_quad = render_pass->CopyFromAndAppendDrawQuad( |
447 delegated_quad, output_shared_quad_state); | 453 delegated_quad, output_shared_quad_state); |
448 output_quad->visible_rect = quad_visible_rect; | 454 output_quad->visible_rect = quad_visible_rect; |
449 } else { | 455 } else { |
450 RenderPass::Id delegated_contributing_render_pass_id = | 456 RenderPass::Id delegated_contributing_render_pass_id = |
451 RenderPassDrawQuad::MaterialCast(delegated_quad)->render_pass_id; | 457 RenderPassDrawQuad::MaterialCast(delegated_quad)->render_pass_id; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
483 if (own_child_id_) { | 489 if (own_child_id_) { |
484 ResourceProvider* provider = layer_tree_impl()->resource_provider(); | 490 ResourceProvider* provider = layer_tree_impl()->resource_provider(); |
485 provider->DestroyChild(child_id_); | 491 provider->DestroyChild(child_id_); |
486 } | 492 } |
487 | 493 |
488 resources_.clear(); | 494 resources_.clear(); |
489 child_id_ = 0; | 495 child_id_ = 0; |
490 } | 496 } |
491 | 497 |
492 } // namespace cc | 498 } // namespace cc |
OLD | NEW |