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

Side by Side Diff: cc/nine_patch_layer_impl.h

Issue 11446076: Added LayerTreeHostImpl::layerTreeAsJson which serializes a layer tree (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | Annotate | Revision Log
« no previous file with comments | « cc/layer_tree_host_perftest.cc ('k') | cc/nine_patch_layer_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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"
11 #include "ui/gfx/size.h" 11 #include "ui/gfx/size.h"
12 #include "ui/gfx/rect.h" 12 #include "ui/gfx/rect.h"
13 13
14 namespace base {
15 class DictionaryValue;
16 }
17
14 namespace cc { 18 namespace cc {
15 19
16 class CC_EXPORT NinePatchLayerImpl : public LayerImpl { 20 class CC_EXPORT NinePatchLayerImpl : public LayerImpl {
17 public: 21 public:
18 static scoped_ptr<NinePatchLayerImpl> create(int id) 22 static scoped_ptr<NinePatchLayerImpl> create(int id)
19 { 23 {
20 return make_scoped_ptr(new NinePatchLayerImpl(id)); 24 return make_scoped_ptr(new NinePatchLayerImpl(id));
21 } 25 }
22 virtual ~NinePatchLayerImpl(); 26 virtual ~NinePatchLayerImpl();
23 27
24 void setResourceId(unsigned id) { m_resourceId = id; } 28 void setResourceId(unsigned id) { m_resourceId = id; }
25 void setLayout(const gfx::Size& imageBounds, const gfx::Rect& aperture); 29 void setLayout(const gfx::Size& imageBounds, const gfx::Rect& aperture);
26 30
27 virtual void willDraw(ResourceProvider*) OVERRIDE; 31 virtual void willDraw(ResourceProvider*) OVERRIDE;
28 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE; 32 virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE;
29 virtual void didDraw(ResourceProvider*) OVERRIDE; 33 virtual void didDraw(ResourceProvider*) OVERRIDE;
30 virtual ResourceProvider::ResourceId contentsResourceId() const OVERRIDE; 34 virtual ResourceProvider::ResourceId contentsResourceId() const OVERRIDE;
31 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE; 35 virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE;
32 virtual void didLoseOutputSurface() OVERRIDE; 36 virtual void didLoseOutputSurface() OVERRIDE;
33 37
38 virtual base::DictionaryValue* layerTreeAsJson() const OVERRIDE;
39
34 protected: 40 protected:
35 explicit NinePatchLayerImpl(int id); 41 explicit NinePatchLayerImpl(int id);
36 42
37 private: 43 private:
38 virtual const char* layerTypeAsString() const OVERRIDE; 44 virtual const char* layerTypeAsString() const OVERRIDE;
39 45
40 // The size of the NinePatch bitmap in pixels. 46 // The size of the NinePatch bitmap in pixels.
41 gfx::Size m_imageBounds; 47 gfx::Size m_imageBounds;
42 48
43 // The transparent center region that shows the parent layer's contents in i mage space. 49 // The transparent center region that shows the parent layer's contents in i mage space.
44 gfx::Rect m_imageAperture; 50 gfx::Rect m_imageAperture;
45 51
46 ResourceProvider::ResourceId m_resourceId; 52 ResourceProvider::ResourceId m_resourceId;
47 }; 53 };
48 54
49 } // namespace cc 55 } // namespace cc
50 56
51 #endif // CC_NINE_PATCH_LAYER_IMPL_H_ 57 #endif // CC_NINE_PATCH_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layer_tree_host_perftest.cc ('k') | cc/nine_patch_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698