| 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 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 namespace { | 27 namespace { |
| 28 | 28 |
| 29 scoped_refptr<cc::SurfaceLayer> CreateSurfaceLayer( | 29 scoped_refptr<cc::SurfaceLayer> CreateSurfaceLayer( |
| 30 cc::SurfaceManager* surface_manager, | 30 cc::SurfaceManager* surface_manager, |
| 31 cc::SurfaceId surface_id, | 31 cc::SurfaceId surface_id, |
| 32 const gfx::Size surface_size, | 32 const gfx::Size surface_size, |
| 33 bool surface_opaque) { | 33 bool surface_opaque) { |
| 34 // manager must outlive compositors using it. | 34 // manager must outlive compositors using it. |
| 35 auto layer = cc::SurfaceLayer::Create(surface_manager->reference_factory()); | 35 auto layer = cc::SurfaceLayer::Create(surface_manager->reference_factory()); |
| 36 layer->SetSurfaceInfo(cc::SurfaceInfo(surface_id, 1.f, surface_size), | 36 layer->SetSurfaceInfo(cc::SurfaceInfo(surface_id, 1.f, surface_size)); |
| 37 false /* stretch_content_to_fill_bounds */); | |
| 38 layer->SetBounds(surface_size); | 37 layer->SetBounds(surface_size); |
| 39 layer->SetIsDrawable(true); | 38 layer->SetIsDrawable(true); |
| 40 layer->SetContentsOpaque(surface_opaque); | 39 layer->SetContentsOpaque(surface_opaque); |
| 41 | 40 |
| 42 return layer; | 41 return layer; |
| 43 } | 42 } |
| 44 | 43 |
| 45 void CopyOutputRequestCallback( | 44 void CopyOutputRequestCallback( |
| 46 scoped_refptr<cc::Layer> readback_layer, | 45 scoped_refptr<cc::Layer> readback_layer, |
| 47 cc::CopyOutputRequest::CopyOutputRequestCallback result_callback, | 46 cc::CopyOutputRequest::CopyOutputRequestCallback result_callback, |
| (...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 content_size_in_dip.width() < container_size_in_dip_.width() || | 246 content_size_in_dip.width() < container_size_in_dip_.width() || |
| 248 content_size_in_dip.height() < container_size_in_dip_.height(); | 247 content_size_in_dip.height() < container_size_in_dip_.height(); |
| 249 } else { | 248 } else { |
| 250 background_is_drawable = true; | 249 background_is_drawable = true; |
| 251 } | 250 } |
| 252 | 251 |
| 253 background_layer_->SetIsDrawable(background_is_drawable); | 252 background_layer_->SetIsDrawable(background_is_drawable); |
| 254 } | 253 } |
| 255 | 254 |
| 256 } // namespace ui | 255 } // namespace ui |
| OLD | NEW |