OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "cc/layers/surface_layer.h" | 5 #include "cc/layers/surface_layer.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 const RequireCallback& require_callback) | 50 const RequireCallback& require_callback) |
51 : surface_scale_(1.f), | 51 : surface_scale_(1.f), |
52 satisfy_callback_(satisfy_callback), | 52 satisfy_callback_(satisfy_callback), |
53 require_callback_(require_callback) {} | 53 require_callback_(require_callback) {} |
54 | 54 |
55 SurfaceLayer::~SurfaceLayer() { | 55 SurfaceLayer::~SurfaceLayer() { |
56 DCHECK(!layer_tree_host()); | 56 DCHECK(!layer_tree_host()); |
57 DCHECK(destroy_sequence_.is_null()); | 57 DCHECK(destroy_sequence_.is_null()); |
58 } | 58 } |
59 | 59 |
60 void SurfaceLayer::SetSurfaceId(SurfaceId surface_id, | 60 void SurfaceLayer::SetSurfaceId(const SurfaceId& surface_id, |
61 float scale, | 61 float scale, |
62 const gfx::Size& size) { | 62 const gfx::Size& size) { |
63 SatisfyDestroySequence(); | 63 SatisfyDestroySequence(); |
64 surface_id_ = surface_id; | 64 surface_id_ = surface_id; |
65 surface_size_ = size; | 65 surface_size_ = size; |
66 surface_scale_ = scale; | 66 surface_scale_ = scale; |
67 CreateNewDestroySequence(); | 67 CreateNewDestroySequence(); |
68 | 68 |
69 UpdateDrawsContent(HasDrawableContent()); | 69 UpdateDrawsContent(HasDrawableContent()); |
70 SetNeedsPushProperties(); | 70 SetNeedsPushProperties(); |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 if (!layer_tree_host()) | 112 if (!layer_tree_host()) |
113 return; | 113 return; |
114 DCHECK(!destroy_sequence_.is_null()); | 114 DCHECK(!destroy_sequence_.is_null()); |
115 std::unique_ptr<SatisfySwapPromise> satisfy( | 115 std::unique_ptr<SatisfySwapPromise> satisfy( |
116 new SatisfySwapPromise(destroy_sequence_, satisfy_callback_)); | 116 new SatisfySwapPromise(destroy_sequence_, satisfy_callback_)); |
117 layer_tree_host()->QueueSwapPromise(std::move(satisfy)); | 117 layer_tree_host()->QueueSwapPromise(std::move(satisfy)); |
118 destroy_sequence_ = SurfaceSequence(); | 118 destroy_sequence_ = SurfaceSequence(); |
119 } | 119 } |
120 | 120 |
121 } // namespace cc | 121 } // namespace cc |
OLD | NEW |