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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
45 | 45 |
46 scoped_refptr<cc::SurfaceLayer> CreateSurfaceLayer( | 46 scoped_refptr<cc::SurfaceLayer> CreateSurfaceLayer( |
47 cc::SurfaceManager* surface_manager, | 47 cc::SurfaceManager* surface_manager, |
48 cc::SurfaceId surface_id, | 48 cc::SurfaceId surface_id, |
49 const gfx::Size surface_size, | 49 const gfx::Size surface_size, |
50 bool surface_opaque) { | 50 bool surface_opaque) { |
51 // manager must outlive compositors using it. | 51 // manager must outlive compositors using it. |
52 scoped_refptr<cc::SurfaceLayer> layer = cc::SurfaceLayer::Create( | 52 scoped_refptr<cc::SurfaceLayer> layer = cc::SurfaceLayer::Create( |
53 base::Bind(&SatisfyCallback, base::Unretained(surface_manager)), | 53 base::Bind(&SatisfyCallback, base::Unretained(surface_manager)), |
54 base::Bind(&RequireCallback, base::Unretained(surface_manager))); | 54 base::Bind(&RequireCallback, base::Unretained(surface_manager))); |
55 layer->SetSurfaceId(surface_id, 1.f, surface_size); | 55 layer->SetSurfaceId(surface_id, 1.f, surface_size, |
56 false /* strecth_content_to_fill_bounds */); | |
danakj
2016/12/16 14:30:44
"strecth" => stretch
| |
56 layer->SetBounds(surface_size); | 57 layer->SetBounds(surface_size); |
57 layer->SetIsDrawable(true); | 58 layer->SetIsDrawable(true); |
58 layer->SetContentsOpaque(surface_opaque); | 59 layer->SetContentsOpaque(surface_opaque); |
59 | 60 |
60 return layer; | 61 return layer; |
61 } | 62 } |
62 | 63 |
63 void CopyOutputRequestCallback( | 64 void CopyOutputRequestCallback( |
64 scoped_refptr<cc::Layer> readback_layer, | 65 scoped_refptr<cc::Layer> readback_layer, |
65 cc::CopyOutputRequest::CopyOutputRequestCallback result_callback, | 66 cc::CopyOutputRequest::CopyOutputRequestCallback result_callback, |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
267 content_size_in_dip.width() < container_size_in_dip_.width() || | 268 content_size_in_dip.width() < container_size_in_dip_.width() || |
268 content_size_in_dip.height() < container_size_in_dip_.height(); | 269 content_size_in_dip.height() < container_size_in_dip_.height(); |
269 } else { | 270 } else { |
270 background_is_drawable = true; | 271 background_is_drawable = true; |
271 } | 272 } |
272 | 273 |
273 background_layer_->SetIsDrawable(background_is_drawable); | 274 background_layer_->SetIsDrawable(background_is_drawable); |
274 } | 275 } |
275 | 276 |
276 } // namespace ui | 277 } // namespace ui |
OLD | NEW |