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

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

Issue 2503363003: Fix three causes of blank thumbnails [2nd land] (Closed)
Patch Set: Rebase 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
« no previous file with comments | « chrome/browser/android/compositor/tab_content_manager.cc ('k') | 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/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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 !current_frame_->has_transparent_background); 178 !current_frame_->has_transparent_background);
179 readback_layer->SetHideLayerAndSubtree(true); 179 readback_layer->SetHideLayerAndSubtree(true);
180 compositor->AttachLayerForReadback(readback_layer); 180 compositor->AttachLayerForReadback(readback_layer);
181 std::unique_ptr<cc::CopyOutputRequest> copy_output_request = 181 std::unique_ptr<cc::CopyOutputRequest> copy_output_request =
182 cc::CopyOutputRequest::CreateRequest(base::Bind( 182 cc::CopyOutputRequest::CreateRequest(base::Bind(
183 &CopyOutputRequestCallback, readback_layer, result_callback)); 183 &CopyOutputRequestCallback, readback_layer, result_callback));
184 184
185 if (!src_subrect_in_pixel.IsEmpty()) 185 if (!src_subrect_in_pixel.IsEmpty())
186 copy_output_request->set_area(src_subrect_in_pixel); 186 copy_output_request->set_area(src_subrect_in_pixel);
187 187
188 readback_layer->RequestCopyOfOutput(std::move(copy_output_request)); 188 surface_factory_->RequestCopyOfSurface(current_frame_->local_frame_id,
189 std::move(copy_output_request));
189 } 190 }
190 191
191 void DelegatedFrameHostAndroid::DestroyDelegatedContent() { 192 void DelegatedFrameHostAndroid::DestroyDelegatedContent() {
192 if (!current_frame_) 193 if (!current_frame_)
193 return; 194 return;
194 195
195 DCHECK(surface_factory_.get()); 196 DCHECK(surface_factory_.get());
196 DCHECK(content_layer_); 197 DCHECK(content_layer_);
197 198
198 content_layer_->RemoveFromParent(); 199 content_layer_->RemoveFromParent();
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 content_size_in_dip.width() < container_size_in_dip_.width() || 269 content_size_in_dip.width() < container_size_in_dip_.width() ||
269 content_size_in_dip.height() < container_size_in_dip_.height(); 270 content_size_in_dip.height() < container_size_in_dip_.height();
270 } else { 271 } else {
271 background_is_drawable = true; 272 background_is_drawable = true;
272 } 273 }
273 274
274 background_layer_->SetIsDrawable(background_is_drawable); 275 background_layer_->SetIsDrawable(background_is_drawable);
275 } 276 }
276 277
277 } // namespace ui 278 } // namespace ui
OLDNEW
« no previous file with comments | « chrome/browser/android/compositor/tab_content_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698