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/painted_scrollbar_layer.cc

Issue 2317753002: cc: Abstract the LayerTreeHost. (Closed)
Patch Set: Rebase Created 4 years, 3 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/layer.cc ('k') | cc/layers/picture_image_layer.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 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 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 UpdateProperty(scrollbar_->ThumbLength(), &thumb_length_); 164 UpdateProperty(scrollbar_->ThumbLength(), &thumb_length_);
165 } else { 165 } else {
166 UpdateProperty(0, &thumb_thickness_); 166 UpdateProperty(0, &thumb_thickness_);
167 UpdateProperty(0, &thumb_length_); 167 UpdateProperty(0, &thumb_length_);
168 } 168 }
169 } 169 }
170 170
171 void PaintedScrollbarLayer::UpdateInternalContentScale() { 171 void PaintedScrollbarLayer::UpdateInternalContentScale() {
172 float scale = GetLayerTree()->device_scale_factor(); 172 float scale = GetLayerTree()->device_scale_factor();
173 if (layer_tree_host() 173 if (layer_tree_host()
174 ->settings() 174 ->GetSettings()
175 .layer_transforms_should_scale_layer_contents) { 175 .layer_transforms_should_scale_layer_contents) {
176 gfx::Transform transform; 176 gfx::Transform transform;
177 transform = draw_property_utils::ScreenSpaceTransform( 177 transform = draw_property_utils::ScreenSpaceTransform(
178 this, GetLayerTree()->property_trees()->transform_tree); 178 this, GetLayerTree()->property_trees()->transform_tree);
179 179
180 gfx::Vector2dF transform_scales = 180 gfx::Vector2dF transform_scales =
181 MathUtil::ComputeTransform2dScaleComponents(transform, scale); 181 MathUtil::ComputeTransform2dScaleComponents(transform, scale);
182 scale = std::max(transform_scales.x(), transform_scales.y()); 182 scale = std::max(transform_scales.x(), transform_scales.y());
183 } 183 }
184 bool changed = false; 184 bool changed = false;
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 283
284 scrollbar_->PaintPart(&skcanvas, part, layer_rect); 284 scrollbar_->PaintPart(&skcanvas, part, layer_rect);
285 // Make sure that the pixels are no longer mutable to unavoid unnecessary 285 // Make sure that the pixels are no longer mutable to unavoid unnecessary
286 // allocation and copying. 286 // allocation and copying.
287 skbitmap.setImmutable(); 287 skbitmap.setImmutable();
288 288
289 return UIResourceBitmap(skbitmap); 289 return UIResourceBitmap(skbitmap);
290 } 290 }
291 291
292 } // namespace cc 292 } // namespace cc
OLDNEW
« no previous file with comments | « cc/layers/layer.cc ('k') | cc/layers/picture_image_layer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698