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

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

Issue 637913003: Revert of "Converted LayerImpl::bounds() to return SizeF." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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_image_layer_impl_unittest.cc ('k') | cc/layers/picture_layer_impl.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 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.h" 5 #include "cc/layers/picture_layer.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "cc/layers/content_layer_client.h" 8 #include "cc/layers/content_layer_client.h"
9 #include "cc/layers/picture_layer_impl.h" 9 #include "cc/layers/picture_layer_impl.h"
10 #include "cc/trees/layer_tree_impl.h" 10 #include "cc/trees/layer_tree_impl.h"
11 #include "third_party/skia/include/core/SkPictureRecorder.h" 11 #include "third_party/skia/include/core/SkPictureRecorder.h"
12 #include "ui/gfx/geometry/size_conversions.h"
13 #include "ui/gfx/rect_conversions.h" 12 #include "ui/gfx/rect_conversions.h"
14 13
15 namespace cc { 14 namespace cc {
16 15
17 scoped_refptr<PictureLayer> PictureLayer::Create(ContentLayerClient* client) { 16 scoped_refptr<PictureLayer> PictureLayer::Create(ContentLayerClient* client) {
18 return make_scoped_refptr(new PictureLayer(client)); 17 return make_scoped_refptr(new PictureLayer(client));
19 } 18 }
20 19
21 PictureLayer::PictureLayer(ContentLayerClient* client) 20 PictureLayer::PictureLayer(ContentLayerClient* client)
22 : client_(client), 21 : client_(client),
(...skipping 17 matching lines...) Expand all
40 if (layer_impl->bounds().IsEmpty()) { 39 if (layer_impl->bounds().IsEmpty()) {
41 // Update may not get called for an empty layer, so resize here instead. 40 // Update may not get called for an empty layer, so resize here instead.
42 // Using layer_impl because either bounds() or paint_properties().bounds 41 // Using layer_impl because either bounds() or paint_properties().bounds
43 // may disagree and either one could have been pushed to layer_impl. 42 // may disagree and either one could have been pushed to layer_impl.
44 pile_->SetEmptyBounds(); 43 pile_->SetEmptyBounds();
45 } else if (update_source_frame_number_ == 44 } else if (update_source_frame_number_ ==
46 layer_tree_host()->source_frame_number()) { 45 layer_tree_host()->source_frame_number()) {
47 // TODO(ernstm): This DCHECK is only valid as long as the pile's tiling_rect 46 // TODO(ernstm): This DCHECK is only valid as long as the pile's tiling_rect
48 // is identical to the layer_rect. 47 // is identical to the layer_rect.
49 // If update called, then pile size must match bounds pushed to impl layer. 48 // If update called, then pile size must match bounds pushed to impl layer.
50 DCHECK_EQ(gfx::ToCeiledSize(layer_impl->bounds()).ToString(), 49 DCHECK_EQ(layer_impl->bounds().ToString(), pile_->tiling_size().ToString());
51 pile_->tiling_size().ToString());
52 } 50 }
53 51
54 // Unlike other properties, invalidation must always be set on layer_impl. 52 // Unlike other properties, invalidation must always be set on layer_impl.
55 // See PictureLayerImpl::PushPropertiesTo for more details. 53 // See PictureLayerImpl::PushPropertiesTo for more details.
56 layer_impl->invalidation_.Clear(); 54 layer_impl->invalidation_.Clear();
57 layer_impl->invalidation_.Swap(&pile_invalidation_); 55 layer_impl->invalidation_.Swap(&pile_invalidation_);
58 layer_impl->pile_ = PicturePileImpl::CreateFromOther(pile_.get()); 56 layer_impl->pile_ = PicturePileImpl::CreateFromOther(pile_.get());
59 } 57 }
60 58
61 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) { 59 void PictureLayer::SetLayerTreeHost(LayerTreeHost* host) {
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 203
206 bool PictureLayer::HasDrawableContent() const { 204 bool PictureLayer::HasDrawableContent() const {
207 return client_ && Layer::HasDrawableContent(); 205 return client_ && Layer::HasDrawableContent();
208 } 206 }
209 207
210 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) { 208 void PictureLayer::RunMicroBenchmark(MicroBenchmark* benchmark) {
211 benchmark->RunOnLayer(this); 209 benchmark->RunOnLayer(this);
212 } 210 }
213 211
214 } // namespace cc 212 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/picture_image_layer_impl_unittest.cc ('k') | cc/layers/picture_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698