| OLD | NEW |
| 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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 !current_frame_->has_transparent_background); | 174 !current_frame_->has_transparent_background); |
| 175 readback_layer->SetHideLayerAndSubtree(true); | 175 readback_layer->SetHideLayerAndSubtree(true); |
| 176 compositor->AttachLayerForReadback(readback_layer); | 176 compositor->AttachLayerForReadback(readback_layer); |
| 177 std::unique_ptr<cc::CopyOutputRequest> copy_output_request = | 177 std::unique_ptr<cc::CopyOutputRequest> copy_output_request = |
| 178 cc::CopyOutputRequest::CreateRequest(base::Bind( | 178 cc::CopyOutputRequest::CreateRequest(base::Bind( |
| 179 &CopyOutputRequestCallback, readback_layer, result_callback)); | 179 &CopyOutputRequestCallback, readback_layer, result_callback)); |
| 180 | 180 |
| 181 if (!src_subrect_in_pixel.IsEmpty()) | 181 if (!src_subrect_in_pixel.IsEmpty()) |
| 182 copy_output_request->set_area(src_subrect_in_pixel); | 182 copy_output_request->set_area(src_subrect_in_pixel); |
| 183 | 183 |
| 184 surface_factory_->RequestCopyOfSurface(current_frame_->local_frame_id, | 184 readback_layer->RequestCopyOfOutput(std::move(copy_output_request)); |
| 185 std::move(copy_output_request)); | |
| 186 } | 185 } |
| 187 | 186 |
| 188 void DelegatedFrameHostAndroid::DestroyDelegatedContent() { | 187 void DelegatedFrameHostAndroid::DestroyDelegatedContent() { |
| 189 if (!current_frame_) | 188 if (!current_frame_) |
| 190 return; | 189 return; |
| 191 | 190 |
| 192 DCHECK(content_layer_); | 191 DCHECK(content_layer_); |
| 193 | 192 |
| 194 content_layer_->RemoveFromParent(); | 193 content_layer_->RemoveFromParent(); |
| 195 content_layer_ = nullptr; | 194 content_layer_ = nullptr; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 content_size_in_dip.width() < container_size_in_dip_.width() || | 263 content_size_in_dip.width() < container_size_in_dip_.width() || |
| 265 content_size_in_dip.height() < container_size_in_dip_.height(); | 264 content_size_in_dip.height() < container_size_in_dip_.height(); |
| 266 } else { | 265 } else { |
| 267 background_is_drawable = true; | 266 background_is_drawable = true; |
| 268 } | 267 } |
| 269 | 268 |
| 270 background_layer_->SetIsDrawable(background_is_drawable); | 269 background_layer_->SetIsDrawable(background_is_drawable); |
| 271 } | 270 } |
| 272 | 271 |
| 273 } // namespace ui | 272 } // namespace ui |
| OLD | NEW |