Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(799)

Side by Side Diff: cc/layers/delegated_renderer_layer.cc

Issue 93463002: cc: Remove DelegatingRendererLayerClient (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Updated needs_push_properties_ TODO Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/layers/delegated_renderer_layer.h ('k') | cc/layers/delegated_renderer_layer_client.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_client.h"
8 #include "cc/layers/delegated_renderer_layer_impl.h" 7 #include "cc/layers/delegated_renderer_layer_impl.h"
9 #include "cc/output/delegated_frame_data.h" 8 #include "cc/output/delegated_frame_data.h"
10 #include "cc/quads/render_pass_draw_quad.h" 9 #include "cc/quads/render_pass_draw_quad.h"
11 #include "cc/trees/blocking_task_runner.h" 10 #include "cc/trees/blocking_task_runner.h"
12 #include "cc/trees/layer_tree_host.h" 11 #include "cc/trees/layer_tree_host.h"
13 12
14 namespace cc { 13 namespace cc {
15 14
16 scoped_refptr<DelegatedRendererLayer> DelegatedRendererLayer::Create( 15 scoped_refptr<DelegatedRendererLayer> DelegatedRendererLayer::Create(
17 DelegatedRendererLayerClient* client,
18 const scoped_refptr<DelegatedFrameProvider>& frame_provider) { 16 const scoped_refptr<DelegatedFrameProvider>& frame_provider) {
19 return scoped_refptr<DelegatedRendererLayer>( 17 return scoped_refptr<DelegatedRendererLayer>(
20 new DelegatedRendererLayer(client, frame_provider)); 18 new DelegatedRendererLayer(frame_provider));
21 } 19 }
22 20
23 DelegatedRendererLayer::DelegatedRendererLayer( 21 DelegatedRendererLayer::DelegatedRendererLayer(
24 DelegatedRendererLayerClient* client,
25 const scoped_refptr<DelegatedFrameProvider>& frame_provider) 22 const scoped_refptr<DelegatedFrameProvider>& frame_provider)
26 : Layer(), 23 : Layer(),
27 client_(client),
28 frame_provider_(frame_provider), 24 frame_provider_(frame_provider),
29 should_collect_new_frame_(true), 25 should_collect_new_frame_(true),
30 frame_data_(NULL), 26 frame_data_(NULL),
31 main_thread_runner_(BlockingTaskRunner::current()), 27 main_thread_runner_(BlockingTaskRunner::current()),
32 weak_ptrs_(this) { 28 weak_ptrs_(this) {
33 frame_provider_->AddObserver(this); 29 frame_provider_->AddObserver(this);
34 } 30 }
35 31
36 DelegatedRendererLayer::~DelegatedRendererLayer() { 32 DelegatedRendererLayer::~DelegatedRendererLayer() {
37 frame_provider_->RemoveObserver(this); 33 frame_provider_->RemoveObserver(this);
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 delegated_impl->SetDisplaySize(display_size_); 70 delegated_impl->SetDisplaySize(display_size_);
75 71
76 delegated_impl->CreateChildIdIfNeeded( 72 delegated_impl->CreateChildIdIfNeeded(
77 frame_provider_->GetReturnResourcesCallbackForImplThread()); 73 frame_provider_->GetReturnResourcesCallbackForImplThread());
78 74
79 if (frame_data_) 75 if (frame_data_)
80 delegated_impl->SetFrameData(frame_data_, frame_damage_); 76 delegated_impl->SetFrameData(frame_data_, frame_damage_);
81 frame_data_ = NULL; 77 frame_data_ = NULL;
82 frame_damage_ = gfx::RectF(); 78 frame_damage_ = gfx::RectF();
83 79
84 // The ResourceProvider will have the new frame as soon as we push it to the 80 // TODO(danakj): The following line needs to be removed. Currently, removal
85 // pending tree. So resources no longer in use will be returned as well. 81 // breaks unit tests.
danakj 2013/12/03 18:28:27 Can you keep crbug.com/323049 in the comment?
powei 2013/12/03 18:38:53 Done. But do you really want crbug.com/323049 and
86 if (client_)
87 client_->DidCommitFrameData();
88
89 // TODO(danakj): The DidCommitFrameData() notification requires a push
90 // properties to happen in order to notify about resources returned
91 // from the parent compositor that are no longer in use. crbug.com/259090
92 needs_push_properties_ = true; 82 needs_push_properties_ = true;
93 } 83 }
94 84
95 void DelegatedRendererLayer::ProviderHasNewFrame() { 85 void DelegatedRendererLayer::ProviderHasNewFrame() {
96 should_collect_new_frame_ = true; 86 should_collect_new_frame_ = true;
97 SetNeedsUpdate(); 87 SetNeedsUpdate();
98 // The active frame needs to be replaced and resources returned before the 88 // The active frame needs to be replaced and resources returned before the
99 // commit is called complete. 89 // commit is called complete.
100 SetNextCommitWaitsForActivation(); 90 SetNextCommitWaitsForActivation();
101 } 91 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 128
139 // If any quad has a filter operation or a blend mode other than normal, 129 // If any quad has a filter operation or a blend mode other than normal,
140 // then we need an offscreen context to draw this layer's content. 130 // then we need an offscreen context to draw this layer's content.
141 if (FrameDataRequiresFilterContext(frame_data_)) 131 if (FrameDataRequiresFilterContext(frame_data_))
142 layer_tree_host()->set_needs_filter_context(); 132 layer_tree_host()->set_needs_filter_context();
143 133
144 return true; 134 return true;
145 } 135 }
146 136
147 } // namespace cc 137 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/delegated_renderer_layer.h ('k') | cc/layers/delegated_renderer_layer_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698