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

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

Issue 2279113002: Android: Revert use of SurfaceFactory::RequestCopyOfSurface() (Closed)
Patch Set: Created 4 years, 3 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/logging.h" 7 #include "base/logging.h"
8 #include "cc/layers/solid_color_layer.h" 8 #include "cc/layers/solid_color_layer.h"
9 #include "cc/layers/surface_layer.h" 9 #include "cc/layers/surface_layer.h"
10 #include "cc/output/compositor_frame.h" 10 #include "cc/output/compositor_frame.h"
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 current_frame_->surface_size); 167 current_frame_->surface_size);
168 readback_layer->SetHideLayerAndSubtree(true); 168 readback_layer->SetHideLayerAndSubtree(true);
169 compositor->AttachLayerForReadback(readback_layer); 169 compositor->AttachLayerForReadback(readback_layer);
170 std::unique_ptr<cc::CopyOutputRequest> copy_output_request = 170 std::unique_ptr<cc::CopyOutputRequest> copy_output_request =
171 cc::CopyOutputRequest::CreateRequest(base::Bind( 171 cc::CopyOutputRequest::CreateRequest(base::Bind(
172 &CopyOutputRequestCallback, readback_layer, result_callback)); 172 &CopyOutputRequestCallback, readback_layer, result_callback));
173 173
174 if (!src_subrect_in_pixel.IsEmpty()) 174 if (!src_subrect_in_pixel.IsEmpty())
175 copy_output_request->set_area(src_subrect_in_pixel); 175 copy_output_request->set_area(src_subrect_in_pixel);
176 176
177 surface_factory_->RequestCopyOfSurface(current_frame_->surface_id, 177 readback_layer->RequestCopyOfOutput(std::move(copy_output_request));
178 std::move(copy_output_request));
179 } 178 }
180 179
181 void DelegatedFrameHostAndroid::DestroyDelegatedContent() { 180 void DelegatedFrameHostAndroid::DestroyDelegatedContent() {
182 if (!current_frame_) 181 if (!current_frame_)
183 return; 182 return;
184 183
185 DCHECK(surface_factory_.get()); 184 DCHECK(surface_factory_.get());
186 DCHECK(content_layer_); 185 DCHECK(content_layer_);
187 186
188 content_layer_->RemoveFromParent(); 187 content_layer_->RemoveFromParent();
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 content_size_in_dip.width() < container_size_in_dip_.width() || 244 content_size_in_dip.width() < container_size_in_dip_.width() ||
246 content_size_in_dip.height() < container_size_in_dip_.height(); 245 content_size_in_dip.height() < container_size_in_dip_.height();
247 } else { 246 } else {
248 background_is_drawable = true; 247 background_is_drawable = true;
249 } 248 }
250 249
251 background_layer_->SetIsDrawable(background_is_drawable); 250 background_layer_->SetIsDrawable(background_is_drawable);
252 } 251 }
253 252
254 } // namespace ui 253 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698