Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef NinePatchLayerImpl_h | |
| 6 #define NinePatchLayerImpl_h | |
| 7 | |
| 8 #include "cc/layer_impl.h" | |
| 9 #include "cc/resource_provider.h" | |
| 10 #include <public/WebTransformationMatrix.h> | |
|
jamesr
2012/11/01 19:55:43
looks like this include isn't needed
| |
| 11 | |
| 12 namespace cc { | |
| 13 | |
| 14 class NinePatchLayerImpl : public LayerImpl { | |
| 15 public: | |
| 16 static scoped_ptr<NinePatchLayerImpl> create(int id) | |
| 17 { | |
| 18 return make_scoped_ptr(new NinePatchLayerImpl(id)); | |
| 19 } | |
| 20 virtual ~NinePatchLayerImpl(); | |
| 21 | |
| 22 virtual void willDraw(ResourceProvider*) OVERRIDE; | |
| 23 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; | |
| 24 virtual void didDraw(ResourceProvider*) OVERRIDE; | |
| 25 virtual ResourceProvider::ResourceId contentsResourceId() const OVERRIDE; | |
| 26 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; | |
| 27 virtual void didLoseContext() OVERRIDE; | |
| 28 void setResourceId(unsigned id) { m_resourceId = id; } | |
|
jamesr
2012/11/01 19:55:43
nit: could you separate the LayerImpl overrides fr
| |
| 29 void setNinePatchLayout(const IntSize& imageBounds, const IntRect& aperture) ; | |
|
jamesr
2012/11/01 19:55:43
the "NinePatch" part here is somewhat redundant wi
| |
| 30 | |
| 31 protected: | |
| 32 explicit NinePatchLayerImpl(int id); | |
| 33 | |
| 34 private: | |
| 35 | |
| 36 virtual const char* layerTypeAsString() const OVERRIDE; | |
| 37 | |
| 38 // The size of the NinePatch bitmap in pixels. | |
| 39 IntSize m_imageBounds; | |
| 40 | |
| 41 // The transparent center region that shows the parent layer's contents in i mage space. | |
| 42 IntRect m_imageAperture; | |
| 43 | |
| 44 ResourceProvider::ResourceId m_resourceId; | |
| 45 }; | |
| 46 | |
| 47 } | |
| 48 | |
| 49 #endif | |
| OLD | NEW |