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

Side by Side Diff: cc/nine_patch_layer.h

Issue 11304020: cc: Nine patch layer. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add unit tests and address code review Created 8 years, 1 month 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 unified diff | Download patch
OLDNEW
(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 "ui/gfx/rect.h"
12 #include "third_party/skia/include/core/SkBitmap.h"
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 gfx::Rect& 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 gfx::Rect m_imageAperture;
44 };
45
46 }
47
48 #endif
OLDNEW
« no previous file with comments | « cc/image_layer_updater.cc ('k') | cc/nine_patch_layer.cc » ('j') | cc/nine_patch_layer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698