Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Side by Side Diff: cc/layers/surface_layer.cc

Issue 2323423002: cc: Add SwapPromiseManager and SurfaceSequenceGenerator. (Closed)
Patch Set: tests Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/layers/painted_scrollbar_layer.cc ('k') | cc/layers/surface_layer_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "cc/layers/surface_layer_impl.h" 11 #include "cc/layers/surface_layer_impl.h"
12 #include "cc/output/swap_promise.h" 12 #include "cc/output/swap_promise.h"
13 #include "cc/trees/layer_tree_host.h" 13 #include "cc/trees/layer_tree_host.h"
14 #include "cc/trees/surface_sequence_generator.h"
15 #include "cc/trees/swap_promise_manager.h"
14 16
15 namespace cc { 17 namespace cc {
16 18
17 class SatisfySwapPromise : public SwapPromise { 19 class SatisfySwapPromise : public SwapPromise {
18 public: 20 public:
19 SatisfySwapPromise(SurfaceSequence sequence, 21 SatisfySwapPromise(SurfaceSequence sequence,
20 const SurfaceLayer::SatisfyCallback& satisfy_callback) 22 const SurfaceLayer::SatisfyCallback& satisfy_callback)
21 : sequence_(sequence), satisfy_callback_(satisfy_callback) {} 23 : sequence_(sequence), satisfy_callback_(satisfy_callback) {}
22 24
23 ~SatisfySwapPromise() override {} 25 ~SatisfySwapPromise() override {}
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 SurfaceLayerImpl* layer_impl = static_cast<SurfaceLayerImpl*>(layer); 99 SurfaceLayerImpl* layer_impl = static_cast<SurfaceLayerImpl*>(layer);
98 100
99 layer_impl->SetSurfaceId(surface_id_); 101 layer_impl->SetSurfaceId(surface_id_);
100 layer_impl->SetSurfaceSize(surface_size_); 102 layer_impl->SetSurfaceSize(surface_size_);
101 layer_impl->SetSurfaceScale(surface_scale_); 103 layer_impl->SetSurfaceScale(surface_scale_);
102 } 104 }
103 105
104 void SurfaceLayer::CreateNewDestroySequence() { 106 void SurfaceLayer::CreateNewDestroySequence() {
105 DCHECK(destroy_sequence_.is_null()); 107 DCHECK(destroy_sequence_.is_null());
106 if (layer_tree_host()) { 108 if (layer_tree_host()) {
107 destroy_sequence_ = layer_tree_host()->CreateSurfaceSequence(); 109 destroy_sequence_ = layer_tree_host()
110 ->GetSurfaceSequenceGenerator()
111 ->CreateSurfaceSequence();
108 require_callback_.Run(surface_id_, destroy_sequence_); 112 require_callback_.Run(surface_id_, destroy_sequence_);
109 } 113 }
110 } 114 }
111 115
112 void SurfaceLayer::SatisfyDestroySequence() { 116 void SurfaceLayer::SatisfyDestroySequence() {
113 if (!layer_tree_host()) 117 if (!layer_tree_host())
114 return; 118 return;
115 DCHECK(!destroy_sequence_.is_null()); 119 DCHECK(!destroy_sequence_.is_null());
116 std::unique_ptr<SatisfySwapPromise> satisfy( 120 std::unique_ptr<SatisfySwapPromise> satisfy(
117 new SatisfySwapPromise(destroy_sequence_, satisfy_callback_)); 121 new SatisfySwapPromise(destroy_sequence_, satisfy_callback_));
118 layer_tree_host()->QueueSwapPromise(std::move(satisfy)); 122 layer_tree_host()->GetSwapPromiseManager()->QueueSwapPromise(
123 std::move(satisfy));
119 destroy_sequence_ = SurfaceSequence(); 124 destroy_sequence_ = SurfaceSequence();
120 } 125 }
121 126
122 } // namespace cc 127 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/painted_scrollbar_layer.cc ('k') | cc/layers/surface_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698