| OLD | NEW |
| 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_NINE_PATCH_LAYER_IMPL_H_ | 5 #ifndef CC_NINE_PATCH_LAYER_IMPL_H_ |
| 6 #define CC_NINE_PATCH_LAYER_IMPL_H_ | 6 #define CC_NINE_PATCH_LAYER_IMPL_H_ |
| 7 | 7 |
| 8 #include "cc/cc_export.h" | 8 #include "cc/cc_export.h" |
| 9 #include "cc/layer_impl.h" | 9 #include "cc/layer_impl.h" |
| 10 #include "cc/resource_provider.h" | 10 #include "cc/resource_provider.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 public: | 21 public: |
| 22 static scoped_ptr<NinePatchLayerImpl> create(LayerTreeImpl* treeImpl, int id
) | 22 static scoped_ptr<NinePatchLayerImpl> create(LayerTreeImpl* treeImpl, int id
) |
| 23 { | 23 { |
| 24 return make_scoped_ptr(new NinePatchLayerImpl(treeImpl, id)); | 24 return make_scoped_ptr(new NinePatchLayerImpl(treeImpl, id)); |
| 25 } | 25 } |
| 26 virtual ~NinePatchLayerImpl(); | 26 virtual ~NinePatchLayerImpl(); |
| 27 | 27 |
| 28 void setResourceId(unsigned id) { m_resourceId = id; } | 28 void setResourceId(unsigned id) { m_resourceId = id; } |
| 29 void setLayout(const gfx::Size& imageBounds, const gfx::Rect& aperture); | 29 void setLayout(const gfx::Size& imageBounds, const gfx::Rect& aperture); |
| 30 | 30 |
| 31 virtual scoped_ptr<LayerImpl> createLayerImpl(LayerTreeImpl* treeImpl) OVERR
IDE; |
| 32 virtual void pushPropertiesTo(LayerImpl*) OVERRIDE; |
| 33 |
| 31 virtual void willDraw(ResourceProvider*) OVERRIDE; | 34 virtual void willDraw(ResourceProvider*) OVERRIDE; |
| 32 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; | 35 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; |
| 33 virtual void didDraw(ResourceProvider*) OVERRIDE; | 36 virtual void didDraw(ResourceProvider*) OVERRIDE; |
| 34 virtual ResourceProvider::ResourceId contentsResourceId() const OVERRIDE; | 37 virtual ResourceProvider::ResourceId contentsResourceId() const OVERRIDE; |
| 35 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; | 38 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; |
| 36 virtual void didLoseOutputSurface() OVERRIDE; | 39 virtual void didLoseOutputSurface() OVERRIDE; |
| 37 | 40 |
| 38 virtual base::DictionaryValue* layerTreeAsJson() const OVERRIDE; | 41 virtual base::DictionaryValue* layerTreeAsJson() const OVERRIDE; |
| 39 | 42 |
| 40 protected: | 43 protected: |
| 41 NinePatchLayerImpl(LayerTreeImpl* treeImpl, int id); | 44 NinePatchLayerImpl(LayerTreeImpl* treeImpl, int id); |
| 42 | 45 |
| 43 private: | 46 private: |
| 44 virtual const char* layerTypeAsString() const OVERRIDE; | 47 virtual const char* layerTypeAsString() const OVERRIDE; |
| 45 | 48 |
| 46 // The size of the NinePatch bitmap in pixels. | 49 // The size of the NinePatch bitmap in pixels. |
| 47 gfx::Size m_imageBounds; | 50 gfx::Size m_imageBounds; |
| 48 | 51 |
| 49 // The transparent center region that shows the parent layer's contents in i
mage space. | 52 // The transparent center region that shows the parent layer's contents in i
mage space. |
| 50 gfx::Rect m_imageAperture; | 53 gfx::Rect m_imageAperture; |
| 51 | 54 |
| 52 ResourceProvider::ResourceId m_resourceId; | 55 ResourceProvider::ResourceId m_resourceId; |
| 53 }; | 56 }; |
| 54 | 57 |
| 55 } // namespace cc | 58 } // namespace cc |
| 56 | 59 |
| 57 #endif // CC_NINE_PATCH_LAYER_IMPL_H_ | 60 #endif // CC_NINE_PATCH_LAYER_IMPL_H_ |
| OLD | NEW |