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

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

Issue 2251143002: cc: Reland Move data to LayerTree from LayerTreeHost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: better fix? Created 4 years, 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/painted_scrollbar_layer.h" 5 #include "cc/layers/painted_scrollbar_layer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "cc/base/math_util.h" 10 #include "cc/base/math_util.h"
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after
182 if (has_thumb_) { 182 if (has_thumb_) {
183 UpdateProperty(scrollbar_->ThumbThickness(), &thumb_thickness_); 183 UpdateProperty(scrollbar_->ThumbThickness(), &thumb_thickness_);
184 UpdateProperty(scrollbar_->ThumbLength(), &thumb_length_); 184 UpdateProperty(scrollbar_->ThumbLength(), &thumb_length_);
185 } else { 185 } else {
186 UpdateProperty(0, &thumb_thickness_); 186 UpdateProperty(0, &thumb_thickness_);
187 UpdateProperty(0, &thumb_length_); 187 UpdateProperty(0, &thumb_length_);
188 } 188 }
189 } 189 }
190 190
191 void PaintedScrollbarLayer::UpdateInternalContentScale() { 191 void PaintedScrollbarLayer::UpdateInternalContentScale() {
192 float scale = layer_tree_host()->device_scale_factor(); 192 float scale = GetLayerTree()->device_scale_factor();
193 if (layer_tree_host() 193 if (layer_tree_host()
194 ->settings() 194 ->settings()
195 .layer_transforms_should_scale_layer_contents) { 195 .layer_transforms_should_scale_layer_contents) {
196 gfx::Transform transform; 196 gfx::Transform transform;
197 transform = draw_property_utils::ScreenSpaceTransform( 197 transform = draw_property_utils::ScreenSpaceTransform(
198 this, layer_tree_host()->property_trees()->transform_tree); 198 this, GetLayerTree()->property_trees()->transform_tree);
199 199
200 gfx::Vector2dF transform_scales = 200 gfx::Vector2dF transform_scales =
201 MathUtil::ComputeTransform2dScaleComponents(transform, scale); 201 MathUtil::ComputeTransform2dScaleComponents(transform, scale);
202 scale = std::max(transform_scales.x(), transform_scales.y()); 202 scale = std::max(transform_scales.x(), transform_scales.y());
203 } 203 }
204 bool changed = false; 204 bool changed = false;
205 changed |= UpdateProperty(ClampScaleToMaxTextureSize(scale), 205 changed |= UpdateProperty(ClampScaleToMaxTextureSize(scale),
206 &internal_contents_scale_); 206 &internal_contents_scale_);
207 changed |= 207 changed |=
208 UpdateProperty(gfx::ScaleToCeiledSize(bounds(), internal_contents_scale_), 208 UpdateProperty(gfx::ScaleToCeiledSize(bounds(), internal_contents_scale_),
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 304
305 scrollbar_->PaintPart(&skcanvas, part, layer_rect); 305 scrollbar_->PaintPart(&skcanvas, part, layer_rect);
306 // Make sure that the pixels are no longer mutable to unavoid unnecessary 306 // Make sure that the pixels are no longer mutable to unavoid unnecessary
307 // allocation and copying. 307 // allocation and copying.
308 skbitmap.setImmutable(); 308 skbitmap.setImmutable();
309 309
310 return UIResourceBitmap(skbitmap); 310 return UIResourceBitmap(skbitmap);
311 } 311 }
312 312
313 } // namespace cc 313 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698