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/trees/layer_tree_host_impl.h" | 5 #include "cc/trees/layer_tree_host_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 } else { | 581 } else { |
582 DCHECK_EQ(!output_surface_->software_device(), | 582 DCHECK_EQ(!output_surface_->software_device(), |
583 output_surface_->capabilities().delegated_rendering && | 583 output_surface_->capabilities().delegated_rendering && |
584 !output_surface_->capabilities().deferred_gl_initialization) | 584 !output_surface_->capabilities().deferred_gl_initialization) |
585 << output_surface_->capabilities().delegated_rendering << " " | 585 << output_surface_->capabilities().delegated_rendering << " " |
586 << output_surface_->capabilities().deferred_gl_initialization; | 586 << output_surface_->capabilities().deferred_gl_initialization; |
587 return DRAW_MODE_SOFTWARE; | 587 return DRAW_MODE_SOFTWARE; |
588 } | 588 } |
589 } | 589 } |
590 | 590 |
591 static void AppendQuadsForLayer( | |
592 RenderPass* target_render_pass, | |
593 LayerImpl* layer, | |
594 AppendQuadsData* append_quads_data) { | |
595 layer->AppendQuads(target_render_pass, | |
596 layer->draw_properties().occlusion_in_content_space, | |
597 append_quads_data); | |
598 } | |
599 | |
600 static void AppendQuadsForRenderSurfaceLayer( | 591 static void AppendQuadsForRenderSurfaceLayer( |
601 RenderPass* target_render_pass, | 592 RenderPass* target_render_pass, |
602 LayerImpl* layer, | 593 LayerImpl* layer, |
603 const RenderPass* contributing_render_pass, | 594 const RenderPass* contributing_render_pass, |
604 AppendQuadsData* append_quads_data) { | 595 AppendQuadsData* append_quads_data) { |
605 RenderSurfaceImpl* surface = layer->render_surface(); | 596 RenderSurfaceImpl* surface = layer->render_surface(); |
606 const gfx::Transform& draw_transform = surface->draw_transform(); | 597 const gfx::Transform& draw_transform = surface->draw_transform(); |
607 const Occlusion& occlusion = surface->occlusion_in_content_space(); | 598 const Occlusion& occlusion = surface->occlusion_in_content_space(); |
608 SkColor debug_border_color = surface->GetDebugBorderColor(); | 599 SkColor debug_border_color = surface->GetDebugBorderColor(); |
609 float debug_border_width = surface->GetDebugBorderWidth(); | 600 float debug_border_width = surface->GetDebugBorderWidth(); |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 frame->will_draw_layers.push_back(*it); | 802 frame->will_draw_layers.push_back(*it); |
812 | 803 |
813 if (it->HasContributingDelegatedRenderPasses()) { | 804 if (it->HasContributingDelegatedRenderPasses()) { |
814 RenderPassId contributing_render_pass_id = | 805 RenderPassId contributing_render_pass_id = |
815 it->FirstContributingRenderPassId(); | 806 it->FirstContributingRenderPassId(); |
816 while (frame->render_passes_by_id.find(contributing_render_pass_id) != | 807 while (frame->render_passes_by_id.find(contributing_render_pass_id) != |
817 frame->render_passes_by_id.end()) { | 808 frame->render_passes_by_id.end()) { |
818 RenderPass* render_pass = | 809 RenderPass* render_pass = |
819 frame->render_passes_by_id[contributing_render_pass_id]; | 810 frame->render_passes_by_id[contributing_render_pass_id]; |
820 | 811 |
821 AppendQuadsForLayer(render_pass, | 812 it->AppendQuads(render_pass, &append_quads_data); |
822 *it, | |
823 &append_quads_data); | |
824 | 813 |
825 contributing_render_pass_id = | 814 contributing_render_pass_id = |
826 it->NextContributingRenderPassId(contributing_render_pass_id); | 815 it->NextContributingRenderPassId(contributing_render_pass_id); |
827 } | 816 } |
828 } | 817 } |
829 | 818 |
830 AppendQuadsForLayer(target_render_pass, | 819 it->AppendQuads(target_render_pass, &append_quads_data); |
831 *it, | |
832 &append_quads_data); | |
833 | 820 |
834 // For layers that represent themselves, add composite frame timing | 821 // For layers that represent themselves, add composite frame timing |
835 // requests if the visible rect intersects the requested rect. | 822 // requests if the visible rect intersects the requested rect. |
836 for (const auto& request : it->frame_timing_requests()) { | 823 for (const auto& request : it->frame_timing_requests()) { |
837 const gfx::Rect& request_content_rect = | 824 const gfx::Rect& request_content_rect = |
838 it->LayerRectToContentRect(request.rect()); | 825 it->LayerRectToContentRect(request.rect()); |
839 if (request_content_rect.Intersects(it->visible_content_rect())) { | 826 if (request_content_rect.Intersects(it->visible_content_rect())) { |
840 frame->composite_events.push_back( | 827 frame->composite_events.push_back( |
841 FrameTimingTracker::FrameAndRectIds( | 828 FrameTimingTracker::FrameAndRectIds( |
842 active_tree_->source_frame_number(), request.id())); | 829 active_tree_->source_frame_number(), request.id())); |
(...skipping 2644 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3487 (*it)->OnSetNeedsRedrawOnImpl(); | 3474 (*it)->OnSetNeedsRedrawOnImpl(); |
3488 } | 3475 } |
3489 | 3476 |
3490 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfForwardingToMainThread() { | 3477 void LayerTreeHostImpl::NotifySwapPromiseMonitorsOfForwardingToMainThread() { |
3491 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); | 3478 std::set<SwapPromiseMonitor*>::iterator it = swap_promise_monitor_.begin(); |
3492 for (; it != swap_promise_monitor_.end(); it++) | 3479 for (; it != swap_promise_monitor_.end(); it++) |
3493 (*it)->OnForwardScrollUpdateToMainThreadOnImpl(); | 3480 (*it)->OnForwardScrollUpdateToMainThreadOnImpl(); |
3494 } | 3481 } |
3495 | 3482 |
3496 } // namespace cc | 3483 } // namespace cc |
OLD | NEW |