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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: cc/layers/scrollbar_layer.h
===================================================================
--- cc/layers/scrollbar_layer.h (revision 210393)
+++ cc/layers/scrollbar_layer.h (working copy)
@@ -10,13 +10,14 @@
#include "cc/layers/contents_scaling_layer.h"
#include "cc/layers/scrollbar_theme_painter.h"
#include "cc/resources/layer_updater.h"
+#include "cc/resources/ui_resource_manager_client.h"
namespace cc {
-class CachingBitmapContentLayerUpdater;
-class ResourceUpdateQueue;
class ScrollbarThemeComposite;
+class UIResourceBitmap;
-class CC_EXPORT ScrollbarLayer : public ContentsScalingLayer {
+class CC_EXPORT ScrollbarLayer
+ : public ContentsScalingLayer {
enne (OOO) 2013/07/22 23:09:15 style nit: the previous code was also correct styl
powei 2013/07/24 02:28:29 Done.
public:
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
OVERRIDE;
@@ -33,10 +34,6 @@
ScrollbarOrientation Orientation() const;
// Layer interface
- virtual void SetTexturePriorities(const PriorityCalculator& priority_calc)
- OVERRIDE;
- virtual void Update(ResourceUpdateQueue* queue,
- const OcclusionTracker* occlusion) OVERRIDE;
virtual void SetLayerTreeHost(LayerTreeHost* host) OVERRIDE;
virtual void PushPropertiesTo(LayerImpl* layer) OVERRIDE;
virtual void CalculateContentsScale(float ideal_contents_scale,
@@ -49,43 +46,40 @@
virtual ScrollbarLayer* ToScrollbarLayer() OVERRIDE;
+ virtual void Update(ResourceUpdateQueue* queue,
enne (OOO) 2013/07/22 23:09:15 style nit: please keep this where it was with the
powei 2013/07/24 02:28:29 Done.
+ const OcclusionTracker* occlusion) OVERRIDE;
+
+ // Callback functions for UI Resource Manager
+ scoped_refptr<UIResourceBitmap> GetTrackBitmap(bool resource_lost);
aelias_OOO_until_Jul13 2013/07/23 00:06:48 Make these private (that should compile fine).
powei 2013/07/24 02:28:29 Done.
+ scoped_refptr<UIResourceBitmap> GetThumbBitmap(bool resource_lost);
+
protected:
ScrollbarLayer(scoped_ptr<Scrollbar> scrollbar,
int scroll_layer_id);
virtual ~ScrollbarLayer();
private:
- void UpdatePart(CachingBitmapContentLayerUpdater* painter,
- LayerUpdater::Resource* resource,
- gfx::Rect rect,
- ResourceUpdateQueue* queue);
- void CreateUpdaterIfNeeded();
gfx::Rect ScrollbarLayerRectToContentRect(gfx::Rect layer_rect) const;
gfx::Rect OriginThumbRect() const;
- bool is_dirty() const { return !dirty_rect_.IsEmpty(); }
-
int MaxTextureSize();
float ClampScaleToMaxTextureSize(float scale);
+ void RasterizeTrackAndThumb();
+
scoped_ptr<Scrollbar> scrollbar_;
int thumb_thickness_;
int thumb_length_;
gfx::Rect track_rect_;
+ gfx::Rect thumb_rect_;
int scroll_layer_id_;
- unsigned texture_format_;
+ UIResourceId track_ui_resource_id_;
+ UIResourceId thumb_ui_resource_id_;
+ scoped_refptr<UIResourceBitmap> track_bitmap_;
+ scoped_refptr<UIResourceBitmap> thumb_bitmap_;
- gfx::RectF dirty_rect_;
-
- scoped_refptr<CachingBitmapContentLayerUpdater> track_updater_;
- scoped_refptr<CachingBitmapContentLayerUpdater> thumb_updater_;
-
- // All the parts of the scrollbar except the thumb
- scoped_ptr<LayerUpdater::Resource> track_;
- scoped_ptr<LayerUpdater::Resource> thumb_;
-
DISALLOW_COPY_AND_ASSIGN(ScrollbarLayer);
};
« no previous file with comments | « cc/cc_tests.gyp ('k') | cc/layers/scrollbar_layer.cc » ('j') | cc/layers/scrollbar_layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698