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 NinePatchLayer_h | |
6 #define NinePatchLayer_h | |
7 | |
8 #include "base/memory/scoped_ptr.h" | |
9 #include "cc/layer.h" | |
10 #include "cc/image_layer_updater.h" | |
11 #include "IntRect.h" | |
12 #include "SkBitmap.h" | |
jamesr
2012/11/01 19:55:43
use "third_party/skia/include/.." style include pa
| |
13 | |
14 namespace cc { | |
15 | |
16 class ResourceUpdateQueue; | |
17 | |
18 class NinePatchLayer : public Layer { | |
19 public: | |
20 static scoped_refptr<NinePatchLayer> create(); | |
21 | |
22 virtual bool drawsContent() const OVERRIDE; | |
23 virtual void setTexturePriorities(const PriorityCalculator&) OVERRIDE; | |
24 virtual void update(ResourceUpdateQueue&, const OcclusionTracker*, Rendering Stats&) OVERRIDE; | |
25 virtual void pushPropertiesTo(LayerImpl*) OVERRIDE; | |
26 | |
27 void setBitmap(const SkBitmap& bitmap, const IntRect& aperture); | |
28 | |
29 private: | |
30 NinePatchLayer(); | |
31 virtual ~NinePatchLayer(); | |
32 virtual scoped_ptr<LayerImpl> createLayerImpl() OVERRIDE; | |
33 | |
34 void createUpdaterIfNeeded(); | |
35 | |
36 scoped_refptr<ImageLayerUpdater> m_updater; | |
37 scoped_ptr<LayerUpdater::Resource> m_resource; | |
38 | |
39 SkBitmap m_bitmap; | |
40 bool m_bitmapDirty; | |
41 | |
42 // The transparent center region that shows the parent layer's contents in i mage space. | |
43 IntRect m_imageAperture; | |
jamesr
2012/11/01 19:55:43
could you use a gfx::Rect here? one less thing to
| |
44 }; | |
45 | |
46 } | |
47 | |
48 #endif | |
OLD | NEW |