| 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 "cc/layers/surface_layer_impl.h" | 7 #include "cc/layers/surface_layer_impl.h" |
| 8 #include "cc/output/swap_promise.h" | 8 #include "cc/output/swap_promise.h" |
| 9 #include "cc/trees/layer_tree_host.h" | 9 #include "cc/trees/layer_tree_host.h" |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 private: | 21 private: |
| 22 void DidActivate() override {} | 22 void DidActivate() override {} |
| 23 void DidSwap(CompositorFrameMetadata* metadata) override { | 23 void DidSwap(CompositorFrameMetadata* metadata) override { |
| 24 metadata->satisfies_sequences.push_back(sequence_.sequence); | 24 metadata->satisfies_sequences.push_back(sequence_.sequence); |
| 25 } | 25 } |
| 26 | 26 |
| 27 void DidNotSwap(DidNotSwapReason reason) override { | 27 void DidNotSwap(DidNotSwapReason reason) override { |
| 28 satisfy_callback_.Run(sequence_); | 28 satisfy_callback_.Run(sequence_); |
| 29 } | 29 } |
| 30 int64 TraceId() const override { return 0; } | 30 int64 TraceId() const override { return 0; } |
| 31 void OnCommit() override { return; } |
| 31 | 32 |
| 32 SurfaceSequence sequence_; | 33 SurfaceSequence sequence_; |
| 33 SurfaceLayer::SatisfyCallback satisfy_callback_; | 34 SurfaceLayer::SatisfyCallback satisfy_callback_; |
| 34 | 35 |
| 35 DISALLOW_COPY_AND_ASSIGN(SatisfySwapPromise); | 36 DISALLOW_COPY_AND_ASSIGN(SatisfySwapPromise); |
| 36 }; | 37 }; |
| 37 | 38 |
| 38 scoped_refptr<SurfaceLayer> SurfaceLayer::Create( | 39 scoped_refptr<SurfaceLayer> SurfaceLayer::Create( |
| 39 const LayerSettings& settings, | 40 const LayerSettings& settings, |
| 40 const SatisfyCallback& satisfy_callback, | 41 const SatisfyCallback& satisfy_callback, |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 if (!layer_tree_host()) | 111 if (!layer_tree_host()) |
| 111 return; | 112 return; |
| 112 DCHECK(!destroy_sequence_.is_null()); | 113 DCHECK(!destroy_sequence_.is_null()); |
| 113 scoped_ptr<SatisfySwapPromise> satisfy( | 114 scoped_ptr<SatisfySwapPromise> satisfy( |
| 114 new SatisfySwapPromise(destroy_sequence_, satisfy_callback_)); | 115 new SatisfySwapPromise(destroy_sequence_, satisfy_callback_)); |
| 115 layer_tree_host()->QueueSwapPromise(satisfy.Pass()); | 116 layer_tree_host()->QueueSwapPromise(satisfy.Pass()); |
| 116 destroy_sequence_ = SurfaceSequence(); | 117 destroy_sequence_ = SurfaceSequence(); |
| 117 } | 118 } |
| 118 | 119 |
| 119 } // namespace cc | 120 } // namespace cc |
| OLD | NEW |