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

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

Issue 1783613004: CC Animation: Erase cc::LayerSettings everywhere. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@eraseandroid
Patch Set: Rebase. Created 4 years, 9 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/surface_layer.h ('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"
(...skipping 22 matching lines...) Expand all
33 } 33 }
34 int64_t TraceId() const override { return 0; } 34 int64_t TraceId() const override { return 0; }
35 35
36 SurfaceSequence sequence_; 36 SurfaceSequence sequence_;
37 SurfaceLayer::SatisfyCallback satisfy_callback_; 37 SurfaceLayer::SatisfyCallback satisfy_callback_;
38 38
39 DISALLOW_COPY_AND_ASSIGN(SatisfySwapPromise); 39 DISALLOW_COPY_AND_ASSIGN(SatisfySwapPromise);
40 }; 40 };
41 41
42 scoped_refptr<SurfaceLayer> SurfaceLayer::Create( 42 scoped_refptr<SurfaceLayer> SurfaceLayer::Create(
43 const LayerSettings& settings,
44 const SatisfyCallback& satisfy_callback, 43 const SatisfyCallback& satisfy_callback,
45 const RequireCallback& require_callback) { 44 const RequireCallback& require_callback) {
46 return make_scoped_refptr( 45 return make_scoped_refptr(
47 new SurfaceLayer(settings, satisfy_callback, require_callback)); 46 new SurfaceLayer(satisfy_callback, require_callback));
48 } 47 }
49 48
50 SurfaceLayer::SurfaceLayer(const LayerSettings& settings, 49 SurfaceLayer::SurfaceLayer(const SatisfyCallback& satisfy_callback,
51 const SatisfyCallback& satisfy_callback,
52 const RequireCallback& require_callback) 50 const RequireCallback& require_callback)
53 : Layer(settings), 51 : surface_scale_(1.f),
54 surface_scale_(1.f),
55 satisfy_callback_(satisfy_callback), 52 satisfy_callback_(satisfy_callback),
56 require_callback_(require_callback) { 53 require_callback_(require_callback) {}
57 }
58 54
59 SurfaceLayer::~SurfaceLayer() { 55 SurfaceLayer::~SurfaceLayer() {
60 DCHECK(!layer_tree_host()); 56 DCHECK(!layer_tree_host());
61 DCHECK(destroy_sequence_.is_null()); 57 DCHECK(destroy_sequence_.is_null());
62 } 58 }
63 59
64 void SurfaceLayer::SetSurfaceId(SurfaceId surface_id, 60 void SurfaceLayer::SetSurfaceId(SurfaceId surface_id,
65 float scale, 61 float scale,
66 const gfx::Size& size) { 62 const gfx::Size& size) {
67 SatisfyDestroySequence(); 63 SatisfyDestroySequence();
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 if (!layer_tree_host()) 111 if (!layer_tree_host())
116 return; 112 return;
117 DCHECK(!destroy_sequence_.is_null()); 113 DCHECK(!destroy_sequence_.is_null());
118 scoped_ptr<SatisfySwapPromise> satisfy( 114 scoped_ptr<SatisfySwapPromise> satisfy(
119 new SatisfySwapPromise(destroy_sequence_, satisfy_callback_)); 115 new SatisfySwapPromise(destroy_sequence_, satisfy_callback_));
120 layer_tree_host()->QueueSwapPromise(std::move(satisfy)); 116 layer_tree_host()->QueueSwapPromise(std::move(satisfy));
121 destroy_sequence_ = SurfaceSequence(); 117 destroy_sequence_ = SurfaceSequence();
122 } 118 }
123 119
124 } // namespace cc 120 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/surface_layer.h ('k') | cc/layers/surface_layer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698