// Copyright 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #ifndef ScrollbarLayerChromium_h #define ScrollbarLayerChromium_h #include "caching_bitmap_canvas_layer_texture_updater.h" #include "cc/layer.h" #include #include #include namespace cc { class Scrollbar; class ScrollbarThemeComposite; class CCTextureUpdateQueue; class ScrollbarLayerChromium : public LayerChromium { public: virtual scoped_ptr createCCLayerImpl() OVERRIDE; static scoped_refptr create(scoped_ptr, WebKit::WebScrollbarThemePainter, scoped_ptr, int scrollLayerId); // LayerChromium interface virtual bool needsContentsScale() const OVERRIDE; virtual IntSize contentBounds() const OVERRIDE; virtual void setTexturePriorities(const CCPriorityCalculator&) OVERRIDE; virtual void update(CCTextureUpdateQueue&, const CCOcclusionTracker*, CCRenderingStats&) OVERRIDE; virtual void setLayerTreeHost(CCLayerTreeHost*) OVERRIDE; virtual void pushPropertiesTo(CCLayerImpl*) OVERRIDE; int scrollLayerId() const { return m_scrollLayerId; } void setScrollLayerId(int id) { m_scrollLayerId = id; } virtual ScrollbarLayerChromium* toScrollbarLayerChromium() OVERRIDE; protected: ScrollbarLayerChromium(scoped_ptr, WebKit::WebScrollbarThemePainter, scoped_ptr, int scrollLayerId); virtual ~ScrollbarLayerChromium(); private: void updatePart(CachingBitmapCanvasLayerTextureUpdater*, LayerTextureUpdater::Texture*, const IntRect&, CCTextureUpdateQueue&, CCRenderingStats&); void createTextureUpdaterIfNeeded(); scoped_ptr m_scrollbar; WebKit::WebScrollbarThemePainter m_painter; scoped_ptr m_geometry; int m_scrollLayerId; GLenum m_textureFormat; scoped_refptr m_backTrackUpdater; scoped_refptr m_foreTrackUpdater; scoped_refptr m_thumbUpdater; // All the parts of the scrollbar except the thumb scoped_ptr m_backTrack; scoped_ptr m_foreTrack; scoped_ptr m_thumb; }; } #endif