Chromium Code Reviews| 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 "base/memory/ptr_util.h" | 9 #include "base/memory/ptr_util.h" |
| 10 #include "cc/layers/solid_color_layer.h" | 10 #include "cc/layers/solid_color_layer.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 44 void CopyOutputRequestCallback( | 44 void CopyOutputRequestCallback( |
| 45 scoped_refptr<cc::Layer> readback_layer, | 45 scoped_refptr<cc::Layer> readback_layer, |
| 46 cc::CopyOutputRequest::CopyOutputRequestCallback result_callback, | 46 cc::CopyOutputRequest::CopyOutputRequestCallback result_callback, |
| 47 std::unique_ptr<cc::CopyOutputResult> copy_output_result) { | 47 std::unique_ptr<cc::CopyOutputResult> copy_output_result) { |
| 48 readback_layer->RemoveFromParent(); | 48 readback_layer->RemoveFromParent(); |
| 49 result_callback.Run(std::move(copy_output_result)); | 49 result_callback.Run(std::move(copy_output_result)); |
| 50 } | 50 } |
| 51 | 51 |
| 52 } // namespace | 52 } // namespace |
| 53 | 53 |
| 54 DelegatedFrameHostAndroid::DelegatedFrameHostAndroid(ui::ViewAndroid* view, | 54 DelegatedFrameHostAndroid::DelegatedFrameHostAndroid( |
| 55 SkColor background_color, | 55 ui::ViewAndroid* view, |
| 56 Client* client) | 56 SkColor background_color, |
| 57 : frame_sink_id_( | 57 Client* client, |
| 58 ui::ContextProviderFactory::GetInstance()->AllocateFrameSinkId()), | 58 cc::FrameSinkId frame_sink_id) |
|
Fady Samuel
2017/01/25 23:23:48
const cc::FrameSinkId&
xlai (Olivia)
2017/01/25 23:43:26
Done here and elsewhere
| |
| 59 : frame_sink_id_(frame_sink_id), | |
| 59 view_(view), | 60 view_(view), |
| 60 client_(client), | 61 client_(client), |
| 61 background_layer_(cc::SolidColorLayer::Create()) { | 62 background_layer_(cc::SolidColorLayer::Create()) { |
| 62 DCHECK(view_); | 63 DCHECK(view_); |
| 63 DCHECK(client_); | 64 DCHECK(client_); |
| 64 | 65 |
| 65 surface_manager_ = | 66 surface_manager_ = |
| 66 ui::ContextProviderFactory::GetInstance()->GetSurfaceManager(); | 67 ui::ContextProviderFactory::GetInstance()->GetSurfaceManager(); |
| 67 surface_id_allocator_.reset(new cc::SurfaceIdAllocator()); | 68 surface_id_allocator_.reset(new cc::SurfaceIdAllocator()); |
| 68 surface_manager_->RegisterFrameSinkId(frame_sink_id_); | 69 surface_manager_->RegisterFrameSinkId(frame_sink_id_); |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 content_size_in_dip.width() < container_size_in_dip_.width() || | 247 content_size_in_dip.width() < container_size_in_dip_.width() || |
| 247 content_size_in_dip.height() < container_size_in_dip_.height(); | 248 content_size_in_dip.height() < container_size_in_dip_.height(); |
| 248 } else { | 249 } else { |
| 249 background_is_drawable = true; | 250 background_is_drawable = true; |
| 250 } | 251 } |
| 251 | 252 |
| 252 background_layer_->SetIsDrawable(background_is_drawable); | 253 background_layer_->SetIsDrawable(background_is_drawable); |
| 253 } | 254 } |
| 254 | 255 |
| 255 } // namespace ui | 256 } // namespace ui |
| OLD | NEW |