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.h" | 5 #include "cc/layers/delegated_renderer_layer.h" |
6 | 6 |
7 #include "cc/layers/delegated_renderer_layer_impl.h" | 7 #include "cc/layers/delegated_renderer_layer_impl.h" |
8 #include "cc/output/delegated_frame_data.h" | 8 #include "cc/output/delegated_frame_data.h" |
9 #include "cc/quads/render_pass_draw_quad.h" | 9 #include "cc/quads/render_pass_draw_quad.h" |
10 #include "cc/trees/blocking_task_runner.h" | 10 #include "cc/trees/blocking_task_runner.h" |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
79 } | 79 } |
80 | 80 |
81 void DelegatedRendererLayer::ProviderHasNewFrame() { | 81 void DelegatedRendererLayer::ProviderHasNewFrame() { |
82 should_collect_new_frame_ = true; | 82 should_collect_new_frame_ = true; |
83 SetNeedsUpdate(); | 83 SetNeedsUpdate(); |
84 // The active frame needs to be replaced and resources returned before the | 84 // The active frame needs to be replaced and resources returned before the |
85 // commit is called complete. | 85 // commit is called complete. |
86 SetNextCommitWaitsForActivation(); | 86 SetNextCommitWaitsForActivation(); |
87 } | 87 } |
88 | 88 |
89 void DelegatedRendererLayer::SetDisplaySize(gfx::Size size) { | 89 void DelegatedRendererLayer::SetDisplaySize(const gfx::Size& size) { |
90 if (display_size_ == size) | 90 if (display_size_ == size) |
91 return; | 91 return; |
92 display_size_ = size; | 92 display_size_ = size; |
93 SetNeedsCommit(); | 93 SetNeedsCommit(); |
94 } | 94 } |
95 | 95 |
96 static bool FrameDataRequiresFilterContext(const DelegatedFrameData* frame) { | 96 static bool FrameDataRequiresFilterContext(const DelegatedFrameData* frame) { |
97 for (size_t i = 0; i < frame->render_pass_list.size(); ++i) { | 97 for (size_t i = 0; i < frame->render_pass_list.size(); ++i) { |
98 const QuadList& quad_list = frame->render_pass_list[i]->quad_list; | 98 const QuadList& quad_list = frame->render_pass_list[i]->quad_list; |
99 for (size_t j = 0; j < quad_list.size(); ++j) { | 99 for (size_t j = 0; j < quad_list.size(); ++j) { |
(...skipping 25 matching lines...) Expand all Loading... |
125 // If any quad has a filter operation or a blend mode other than normal, | 125 // If any quad has a filter operation or a blend mode other than normal, |
126 // then we need an offscreen context to draw this layer's content. | 126 // then we need an offscreen context to draw this layer's content. |
127 if (FrameDataRequiresFilterContext(frame_data_)) | 127 if (FrameDataRequiresFilterContext(frame_data_)) |
128 layer_tree_host()->set_needs_filter_context(); | 128 layer_tree_host()->set_needs_filter_context(); |
129 | 129 |
130 SetNeedsPushProperties(); | 130 SetNeedsPushProperties(); |
131 return true; | 131 return true; |
132 } | 132 } |
133 | 133 |
134 } // namespace cc | 134 } // namespace cc |
OLD | NEW |