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

Side by Side Diff: ui/android/delegated_frame_host_android.cc

Issue 2449853004: Getting rid of DelegatedFrameData (Closed)
Patch Set: Created 4 years, 1 month 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "ui/android/delegated_frame_host_android.h" 5 #include "ui/android/delegated_frame_host_android.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "cc/layers/solid_color_layer.h" 9 #include "cc/layers/solid_color_layer.h"
10 #include "cc/layers/surface_layer.h" 10 #include "cc/layers/surface_layer.h"
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 DelegatedFrameHostAndroid::FrameData::~FrameData() = default; 104 DelegatedFrameHostAndroid::FrameData::~FrameData() = default;
105 105
106 void DelegatedFrameHostAndroid::SubmitCompositorFrame( 106 void DelegatedFrameHostAndroid::SubmitCompositorFrame(
107 cc::CompositorFrame frame, 107 cc::CompositorFrame frame,
108 cc::SurfaceFactory::DrawCallback draw_callback) { 108 cc::SurfaceFactory::DrawCallback draw_callback) {
109 if (!surface_factory_) { 109 if (!surface_factory_) {
110 surface_factory_ = base::WrapUnique( 110 surface_factory_ = base::WrapUnique(
111 new cc::SurfaceFactory(frame_sink_id_, surface_manager_, this)); 111 new cc::SurfaceFactory(frame_sink_id_, surface_manager_, this));
112 } 112 }
113 113
114 cc::RenderPass* root_pass = 114 cc::RenderPass* root_pass = frame.render_pass_list.back().get();
115 frame.delegated_frame_data->render_pass_list.back().get();
116 gfx::Size surface_size = root_pass->output_rect.size(); 115 gfx::Size surface_size = root_pass->output_rect.size();
117 116
118 if (!current_frame_ || surface_size != current_frame_->surface_size || 117 if (!current_frame_ || surface_size != current_frame_->surface_size ||
119 current_frame_->top_controls_height != 118 current_frame_->top_controls_height !=
120 frame.metadata.top_controls_height || 119 frame.metadata.top_controls_height ||
121 current_frame_->top_controls_shown_ratio != 120 current_frame_->top_controls_shown_ratio !=
122 frame.metadata.top_controls_shown_ratio || 121 frame.metadata.top_controls_shown_ratio ||
123 current_frame_->bottom_controls_height != 122 current_frame_->bottom_controls_height !=
124 frame.metadata.bottom_controls_height || 123 frame.metadata.bottom_controls_height ||
125 current_frame_->bottom_controls_shown_ratio != 124 current_frame_->bottom_controls_shown_ratio !=
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 content_size_in_dip.width() < container_size_in_dip_.width() || 267 content_size_in_dip.width() < container_size_in_dip_.width() ||
269 content_size_in_dip.height() < container_size_in_dip_.height(); 268 content_size_in_dip.height() < container_size_in_dip_.height();
270 } else { 269 } else {
271 background_is_drawable = true; 270 background_is_drawable = true;
272 } 271 }
273 272
274 background_layer_->SetIsDrawable(background_is_drawable); 273 background_layer_->SetIsDrawable(background_is_drawable);
275 } 274 }
276 275
277 } // namespace ui 276 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698