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

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

Issue 18191020: UI Resource Manager (Closed) Base URL: https://src.chromium.org/chrome/trunk/src/
Patch Set: Created 7 years, 5 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 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 #ifndef CC_LAYERS_SCROLLBAR_LAYER_H_ 5 #ifndef CC_LAYERS_SCROLLBAR_LAYER_H_
6 #define CC_LAYERS_SCROLLBAR_LAYER_H_ 6 #define CC_LAYERS_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"
11 #include "cc/layers/scrollbar_theme_painter.h" 11 #include "cc/layers/scrollbar_theme_painter.h"
12 #include "cc/resources/layer_updater.h" 12 #include "cc/resources/layer_updater.h"
13 #include "cc/resources/ui_resource_manager.h"
13 14
14 namespace cc { 15 namespace cc {
15 class CachingBitmapContentLayerUpdater;
16 class ResourceUpdateQueue; 16 class ResourceUpdateQueue;
aelias_OOO_until_Jul13 2013/07/10 23:07:22 Also delete this.
powei 2013/07/11 23:54:44 Done.
17 class ScrollbarThemeComposite; 17 class ScrollbarThemeComposite;
18 18
19 class CC_EXPORT ScrollbarLayer : public ContentsScalingLayer { 19 class CC_EXPORT ScrollbarLayer : public ContentsScalingLayer,
20 public UIResourceManagerClient {
aelias_OOO_until_Jul13 2013/07/10 23:07:22 nit: wrong spacing
powei 2013/07/11 23:54:44 Done.
20 public: 21 public:
21 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) 22 virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
22 OVERRIDE; 23 OVERRIDE;
23 24
24 static scoped_refptr<ScrollbarLayer> Create( 25 static scoped_refptr<ScrollbarLayer> Create(
25 scoped_ptr<Scrollbar> scrollbar, 26 scoped_ptr<Scrollbar> scrollbar,
26 int scroll_layer_id); 27 int scroll_layer_id);
27 28
28 int scroll_layer_id() const { return scroll_layer_id_; } 29 int scroll_layer_id() const { return scroll_layer_id_; }
29 void SetScrollLayerId(int id); 30 void SetScrollLayerId(int id);
30 31
31 virtual bool OpacityCanAnimateOnImplThread() const OVERRIDE; 32 virtual bool OpacityCanAnimateOnImplThread() const OVERRIDE;
32 33
33 ScrollbarOrientation Orientation() const; 34 ScrollbarOrientation Orientation() const;
34 35
35 // Layer interface 36 // Layer interface
36 virtual void SetTexturePriorities(const PriorityCalculator& priority_calc)
37 OVERRIDE;
38 virtual void Update(ResourceUpdateQueue* queue, 37 virtual void Update(ResourceUpdateQueue* queue,
aelias_OOO_until_Jul13 2013/07/10 23:07:22 This should be deleted.
powei 2013/07/11 23:54:44 Isn't this function where the bitmaps are generate
aelias_OOO_until_Jul13 2013/07/12 00:52:27 This function is tied to the legacy PrioritizedRes
39 const OcclusionTracker* occlusion) OVERRIDE; 38 const OcclusionTracker* occlusion) OVERRIDE;
40 virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE; 39 virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE;
41 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE; 40 virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
42 virtual void CalculateContentsScale(float ideal_contents_scale, 41 virtual void CalculateContentsScale(float ideal_contents_scale,
43 float device_scale_factor, 42 float device_scale_factor,
44 float page_scale_factor, 43 float page_scale_factor,
45 bool animating_transform_to_screen, 44 bool animating_transform_to_screen,
46 float* contents_scale_x, 45 float* contents_scale_x,
47 float* contents_scale_y, 46 float* contents_scale_y,
48 gfx::Size* content_bounds) OVERRIDE; 47 gfx::Size* content_bounds) OVERRIDE;
49 48
50 virtual ScrollbarLayer* ToScrollbarLayer() OVERRIDE; 49 virtual ScrollbarLayer* ToScrollbarLayer() OVERRIDE;
51 50
51 virtual void UIResourceReady(UIResourceId id) OVERRIDE;
aelias_OOO_until_Jul13 2013/07/10 23:07:22 No need for this here, it should have an empty imp
powei 2013/07/11 23:54:44 Done.
52
52 protected: 53 protected:
53 ScrollbarLayer(scoped_ptr<Scrollbar> scrollbar, 54 ScrollbarLayer(scoped_ptr<Scrollbar> scrollbar,
54 int scroll_layer_id); 55 int scroll_layer_id);
55 virtual ~ScrollbarLayer(); 56 virtual ~ScrollbarLayer();
56 57
57 private: 58 private:
58 void UpdatePart(CachingBitmapContentLayerUpdater* painter,
59 LayerUpdater::Resource* resource,
60 gfx::Rect rect,
61 ResourceUpdateQueue* queue);
62 void CreateUpdaterIfNeeded();
63 gfx::Rect ScrollbarLayerRectToContentRect(gfx::Rect layer_rect) const; 59 gfx::Rect ScrollbarLayerRectToContentRect(gfx::Rect layer_rect) const;
64 gfx::Rect OriginThumbRect() const; 60 gfx::Rect OriginThumbRect() const;
65 61
66 bool is_dirty() const { return !dirty_rect_.IsEmpty(); } 62 bool is_dirty() const { return !dirty_rect_.IsEmpty(); }
67 63
68 int MaxTextureSize(); 64 int MaxTextureSize();
69 float ClampScaleToMaxTextureSize(float scale); 65 float ClampScaleToMaxTextureSize(float scale);
70 66
71 scoped_ptr<Scrollbar> scrollbar_; 67 scoped_ptr<Scrollbar> scrollbar_;
72 68
73 int thumb_thickness_; 69 int thumb_thickness_;
74 int thumb_length_; 70 int thumb_length_;
75 gfx::Rect track_rect_; 71 gfx::Rect track_rect_;
76 int scroll_layer_id_; 72 int scroll_layer_id_;
77 73
78 unsigned texture_format_;
79
80 gfx::RectF dirty_rect_; 74 gfx::RectF dirty_rect_;
81 75
82 scoped_refptr<CachingBitmapContentLayerUpdater> track_updater_; 76 UIResourceId track_ui_resource_id_;
83 scoped_refptr<CachingBitmapContentLayerUpdater> thumb_updater_; 77 UIResourceId thumb_ui_resource_id_;
84 78 scoped_refptr<UIResourceBitmap> track_bitmap_;
85 // All the parts of the scrollbar except the thumb 79 scoped_refptr<UIResourceBitmap> thumb_bitmap_;
86 scoped_ptr<LayerUpdater::Resource> track_; 80 bool skip_update_;
aelias_OOO_until_Jul13 2013/07/10 23:07:22 It doesn't look like this variable does anything u
powei 2013/07/11 23:54:44 Done.
87 scoped_ptr<LayerUpdater::Resource> thumb_;
88 81
89 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayer); 82 DISALLOW_COPY_AND_ASSIGN(ScrollbarLayer);
90 }; 83 };
91 84
92 } // namespace cc 85 } // namespace cc
93 86
94 #endif // CC_LAYERS_SCROLLBAR_LAYER_H_ 87 #endif // CC_LAYERS_SCROLLBAR_LAYER_H_
OLDNEW
« no previous file with comments | « cc/cc.gyp ('k') | cc/layers/scrollbar_layer.cc » ('j') | cc/layers/scrollbar_layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698