| 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/layer_tree_host.h" | 10 #include "cc/trees/layer_tree_host.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 | 65 |
| 66 DelegatedRendererLayerImpl* delegated_impl = | 66 DelegatedRendererLayerImpl* delegated_impl = |
| 67 static_cast<DelegatedRendererLayerImpl*>(impl); | 67 static_cast<DelegatedRendererLayerImpl*>(impl); |
| 68 | 68 |
| 69 delegated_impl->CreateChildIdIfNeeded( | 69 delegated_impl->CreateChildIdIfNeeded( |
| 70 frame_provider_->GetReturnResourcesCallbackForImplThread()); | 70 frame_provider_->GetReturnResourcesCallbackForImplThread()); |
| 71 | 71 |
| 72 if (frame_data_) | 72 if (frame_data_) |
| 73 delegated_impl->SetFrameData(frame_data_, frame_damage_); | 73 delegated_impl->SetFrameData(frame_data_, frame_damage_); |
| 74 frame_data_ = nullptr; | 74 frame_data_ = nullptr; |
| 75 frame_damage_ = gfx::RectF(); | 75 frame_damage_ = gfx::Rect(); |
| 76 } | 76 } |
| 77 | 77 |
| 78 void DelegatedRendererLayer::ProviderHasNewFrame() { | 78 void DelegatedRendererLayer::ProviderHasNewFrame() { |
| 79 should_collect_new_frame_ = true; | 79 should_collect_new_frame_ = true; |
| 80 SetNeedsUpdate(); | 80 SetNeedsUpdate(); |
| 81 // The active frame needs to be replaced and resources returned before the | 81 // The active frame needs to be replaced and resources returned before the |
| 82 // commit is called complete. | 82 // commit is called complete. |
| 83 SetNextCommitWaitsForActivation(); | 83 SetNextCommitWaitsForActivation(); |
| 84 } | 84 } |
| 85 | 85 |
| 86 bool DelegatedRendererLayer::Update() { | 86 bool DelegatedRendererLayer::Update() { |
| 87 bool updated = Layer::Update(); | 87 bool updated = Layer::Update(); |
| 88 if (!should_collect_new_frame_) | 88 if (!should_collect_new_frame_) |
| 89 return updated; | 89 return updated; |
| 90 | 90 |
| 91 frame_data_ = | 91 frame_data_ = |
| 92 frame_provider_->GetFrameDataAndRefResources(this, &frame_damage_); | 92 frame_provider_->GetFrameDataAndRefResources(this, &frame_damage_); |
| 93 should_collect_new_frame_ = false; | 93 should_collect_new_frame_ = false; |
| 94 | 94 |
| 95 SetNeedsPushProperties(); | 95 SetNeedsPushProperties(); |
| 96 return true; | 96 return true; |
| 97 } | 97 } |
| 98 | 98 |
| 99 bool DelegatedRendererLayer::HasDelegatedContent() const { | 99 bool DelegatedRendererLayer::HasDelegatedContent() const { |
| 100 return true; | 100 return true; |
| 101 } | 101 } |
| 102 | 102 |
| 103 } // namespace cc | 103 } // namespace cc |
| OLD | NEW |