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

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

Issue 150603004: Fixed rounding issue on scrollbar rasterization. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed Test Created 6 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 | Annotate | Revision Log
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 #ifndef CC_LAYERS_PAINTED_SCROLLBAR_LAYER_H_ 5 #ifndef CC_LAYERS_PAINTED_SCROLLBAR_LAYER_H_
6 #define CC_LAYERS_PAINTED_SCROLLBAR_LAYER_H_ 6 #define CC_LAYERS_PAINTED_SCROLLBAR_LAYER_H_
7 7
8 #include "cc/base/cc_export.h" 8 #include "cc/base/cc_export.h"
9 #include "cc/input/scrollbar.h" 9 #include "cc/input/scrollbar.h"
10 #include "cc/layers/contents_scaling_layer.h" 10 #include "cc/layers/contents_scaling_layer.h"
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 template<typename T> void UpdateProperty(T value, T* prop) { 70 template<typename T> void UpdateProperty(T value, T* prop) {
71 if (*prop == value) 71 if (*prop == value)
72 return; 72 return;
73 *prop = value; 73 *prop = value;
74 SetNeedsPushProperties(); 74 SetNeedsPushProperties();
75 } 75 }
76 76
77 int MaxTextureSize(); 77 int MaxTextureSize();
78 float ClampScaleToMaxTextureSize(float scale); 78 float ClampScaleToMaxTextureSize(float scale);
79 79
80 UIResourceBitmap RasterizeScrollbarPart(const gfx::Rect& rect, 80 float calculateIdealScale(float content_scale,
81 int layer_edge,
82 int layer_size,
83 int target_size) const;
84
85 UIResourceBitmap RasterizeScrollbarPart(const gfx::Rect& layer_rect,
86 const gfx::Rect& content_rect,
81 ScrollbarPart part); 87 ScrollbarPart part);
82 88
83 scoped_ptr<Scrollbar> scrollbar_; 89 scoped_ptr<Scrollbar> scrollbar_;
84 int scroll_layer_id_; 90 int scroll_layer_id_;
85 int clip_layer_id_; 91 int clip_layer_id_;
86 92
87 // Snapshot of properties taken in UpdateThumbAndTrackGeometry and used in 93 // Snapshot of properties taken in UpdateThumbAndTrackGeometry and used in
88 // PushPropertiesTo. 94 // PushPropertiesTo.
89 int thumb_thickness_; 95 int thumb_thickness_;
90 int thumb_length_; 96 int thumb_length_;
91 gfx::Point location_; 97 gfx::Point location_;
92 gfx::Rect track_rect_; 98 gfx::Rect track_rect_;
93 bool is_overlay_; 99 bool is_overlay_;
94 bool has_thumb_; 100 bool has_thumb_;
95 101
96 scoped_ptr<ScopedUIResource> track_resource_; 102 scoped_ptr<ScopedUIResource> track_resource_;
97 scoped_ptr<ScopedUIResource> thumb_resource_; 103 scoped_ptr<ScopedUIResource> thumb_resource_;
98 104
99 DISALLOW_COPY_AND_ASSIGN(PaintedScrollbarLayer); 105 DISALLOW_COPY_AND_ASSIGN(PaintedScrollbarLayer);
100 }; 106 };
101 107
102 } // namespace cc 108 } // namespace cc
103 109
104 #endif // CC_LAYERS_PAINTED_SCROLLBAR_LAYER_H_ 110 #endif // CC_LAYERS_PAINTED_SCROLLBAR_LAYER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/layers/painted_scrollbar_layer.cc » ('j') | cc/layers/painted_scrollbar_layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698