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

Unified Diff: cc/nine_patch_layer_impl.h

Issue 11304020: cc: Nine patch layer. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix DCHECK failures and rebase to 166129 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/nine_patch_layer.cc ('k') | cc/nine_patch_layer_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/nine_patch_layer_impl.h
diff --git a/cc/nine_patch_layer_impl.h b/cc/nine_patch_layer_impl.h
new file mode 100644
index 0000000000000000000000000000000000000000..476f5bb63d24f7266fd7111b5126587cc8bbc80e
--- /dev/null
+++ b/cc/nine_patch_layer_impl.h
@@ -0,0 +1,51 @@
+// Copyright 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef NinePatchLayerImpl_h
+#define NinePatchLayerImpl_h
+
+#include "cc/cc_export.h"
+#include "cc/layer_impl.h"
+#include "cc/resource_provider.h"
+#include "ui/gfx/size.h"
+#include "ui/gfx/rect.h"
+
+namespace cc {
+
+class CC_EXPORT NinePatchLayerImpl : public LayerImpl {
+public:
+ static scoped_ptr<NinePatchLayerImpl> create(int id)
+ {
+ return make_scoped_ptr(new NinePatchLayerImpl(id));
+ }
+ virtual ~NinePatchLayerImpl();
+
+ void setResourceId(unsigned id) { m_resourceId = id; }
+ void setLayout(const gfx::Size& imageBounds, const gfx::Rect& aperture);
+
+ virtual void willDraw(ResourceProvider*) OVERRIDE;
+ virtual void appendQuads(QuadSink&, AppendQuadsData&) OVERRIDE;
+ virtual void didDraw(ResourceProvider*) OVERRIDE;
+ virtual ResourceProvider::ResourceId contentsResourceId() const OVERRIDE;
+ virtual void dumpLayerProperties(std::string*, int indent) const OVERRIDE;
+ virtual void didLoseContext() OVERRIDE;
+
+protected:
+ explicit NinePatchLayerImpl(int id);
+
+private:
+ virtual const char* layerTypeAsString() const OVERRIDE;
+
+ // The size of the NinePatch bitmap in pixels.
+ gfx::Size m_imageBounds;
+
+ // The transparent center region that shows the parent layer's contents in image space.
+ gfx::Rect m_imageAperture;
+
+ ResourceProvider::ResourceId m_resourceId;
+};
+
+}
+
+#endif
« no previous file with comments | « cc/nine_patch_layer.cc ('k') | cc/nine_patch_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698