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

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

Issue 800613009: Convert scroll offsets to use SyncedProperty. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Android WebView tests Created 5 years, 10 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/picture_layer_impl.h ('k') | cc/layers/tiled_layer_impl.h » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/picture_layer_impl.h" 5 #include "cc/layers/picture_layer_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 #include <limits> 9 #include <limits>
10 #include <set> 10 #include <set>
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 } 58 }
59 59
60 PictureLayerImpl::Pair::Pair(PictureLayerImpl* active_layer, 60 PictureLayerImpl::Pair::Pair(PictureLayerImpl* active_layer,
61 PictureLayerImpl* pending_layer) 61 PictureLayerImpl* pending_layer)
62 : active(active_layer), pending(pending_layer) { 62 : active(active_layer), pending(pending_layer) {
63 } 63 }
64 64
65 PictureLayerImpl::Pair::~Pair() { 65 PictureLayerImpl::Pair::~Pair() {
66 } 66 }
67 67
68 PictureLayerImpl::PictureLayerImpl(LayerTreeImpl* tree_impl, 68 PictureLayerImpl::PictureLayerImpl(
69 int id, 69 LayerTreeImpl* tree_impl,
70 bool is_mask) 70 int id,
71 : LayerImpl(tree_impl, id), 71 bool is_mask,
72 scoped_refptr<SyncedScrollOffset> scroll_offset)
73 : LayerImpl(tree_impl, id, scroll_offset),
72 twin_layer_(nullptr), 74 twin_layer_(nullptr),
73 tilings_(CreatePictureLayerTilingSet()), 75 tilings_(CreatePictureLayerTilingSet()),
74 ideal_page_scale_(0.f), 76 ideal_page_scale_(0.f),
75 ideal_device_scale_(0.f), 77 ideal_device_scale_(0.f),
76 ideal_source_scale_(0.f), 78 ideal_source_scale_(0.f),
77 ideal_contents_scale_(0.f), 79 ideal_contents_scale_(0.f),
78 raster_page_scale_(0.f), 80 raster_page_scale_(0.f),
79 raster_device_scale_(0.f), 81 raster_device_scale_(0.f),
80 raster_source_scale_(0.f), 82 raster_source_scale_(0.f),
81 raster_contents_scale_(0.f), 83 raster_contents_scale_(0.f),
(...skipping 11 matching lines...) Expand all
93 twin_layer_->twin_layer_ = nullptr; 95 twin_layer_->twin_layer_ = nullptr;
94 layer_tree_impl()->UnregisterPictureLayerImpl(this); 96 layer_tree_impl()->UnregisterPictureLayerImpl(this);
95 } 97 }
96 98
97 const char* PictureLayerImpl::LayerTypeAsString() const { 99 const char* PictureLayerImpl::LayerTypeAsString() const {
98 return "cc::PictureLayerImpl"; 100 return "cc::PictureLayerImpl";
99 } 101 }
100 102
101 scoped_ptr<LayerImpl> PictureLayerImpl::CreateLayerImpl( 103 scoped_ptr<LayerImpl> PictureLayerImpl::CreateLayerImpl(
102 LayerTreeImpl* tree_impl) { 104 LayerTreeImpl* tree_impl) {
103 return PictureLayerImpl::Create(tree_impl, id(), is_mask_); 105 return PictureLayerImpl::Create(tree_impl, id(), is_mask_,
106 synced_scroll_offset());
104 } 107 }
105 108
106 void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) { 109 void PictureLayerImpl::PushPropertiesTo(LayerImpl* base_layer) {
107 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer); 110 PictureLayerImpl* layer_impl = static_cast<PictureLayerImpl*>(base_layer);
108 DCHECK_EQ(layer_impl->is_mask_, is_mask_); 111 DCHECK_EQ(layer_impl->is_mask_, is_mask_);
109 112
110 LayerImpl::PushPropertiesTo(base_layer); 113 LayerImpl::PushPropertiesTo(base_layer);
111 114
112 // Twin relationships should never change once established. 115 // Twin relationships should never change once established.
113 DCHECK_IMPLIES(twin_layer_, twin_layer_ == layer_impl); 116 DCHECK_IMPLIES(twin_layer_, twin_layer_ == layer_impl);
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after
1225 1228
1226 bool PictureLayerImpl::IsOnActiveOrPendingTree() const { 1229 bool PictureLayerImpl::IsOnActiveOrPendingTree() const {
1227 return !layer_tree_impl()->IsRecycleTree(); 1230 return !layer_tree_impl()->IsRecycleTree();
1228 } 1231 }
1229 1232
1230 bool PictureLayerImpl::HasValidTilePriorities() const { 1233 bool PictureLayerImpl::HasValidTilePriorities() const {
1231 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember(); 1234 return IsOnActiveOrPendingTree() && IsDrawnRenderSurfaceLayerListMember();
1232 } 1235 }
1233 1236
1234 } // namespace cc 1237 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_layer_impl.h ('k') | cc/layers/tiled_layer_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698