summaryrefslogtreecommitdiff
path: root/chromium/cc/layers/nine_patch_layer_impl.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/cc/layers/nine_patch_layer_impl.h')
-rw-r--r--chromium/cc/layers/nine_patch_layer_impl.h42
1 files changed, 38 insertions, 4 deletions
diff --git a/chromium/cc/layers/nine_patch_layer_impl.h b/chromium/cc/layers/nine_patch_layer_impl.h
index bc442d43f33..ba414aed391 100644
--- a/chromium/cc/layers/nine_patch_layer_impl.h
+++ b/chromium/cc/layers/nine_patch_layer_impl.h
@@ -10,6 +10,7 @@
#include "cc/base/cc_export.h"
#include "cc/layers/layer_impl.h"
#include "cc/resources/resource_provider.h"
+#include "cc/resources/ui_resource_client.h"
#include "ui/gfx/rect.h"
#include "ui/gfx/size.h"
@@ -27,8 +28,37 @@ class CC_EXPORT NinePatchLayerImpl : public LayerImpl {
}
virtual ~NinePatchLayerImpl();
- void SetResourceId(unsigned id) { resource_id_ = id; }
- void SetLayout(gfx::Size image_bounds, gfx::Rect aperture);
+
+ void SetUIResourceId(UIResourceId uid);
+
+ // The bitmap stretches out the bounds of the layer. The following picture
+ // illustrates the parameters associated with the dimensions.
+ //
+ // Layer space layout Bitmap space layout
+ //
+ // ------------------------ ~~~~~~~~~~ W ~~~~~~~~~~
+ // | : | : : |
+ // | C | : Y |
+ // | : | : : |
+ // | ------------ | :~~X~~------------ |
+ // | | | | : | : |
+ // | | | | : | : |
+ // |~~A~~| |~~B~~| H | Q |
+ // | | | | : | : |
+ // | ------------ | : ~~~~~P~~~~~ |
+ // | : | : |
+ // | D | : |
+ // | : | : |
+ // ------------------------ ------------------------
+ //
+ // |image_bounds| = (W, H)
+ // |image_aperture| = (X, Y, P, Q)
+ // |border| = (A, C, A + B, C + D)
+ // |fill_center| indicates whether to draw the center quad or not.
+ void SetLayout(gfx::Size image_bounds,
+ gfx::Rect image_aperture,
+ gfx::Rect border,
+ bool fill_center);
virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl)
OVERRIDE;
@@ -39,7 +69,6 @@ class CC_EXPORT NinePatchLayerImpl : public LayerImpl {
virtual void AppendQuads(QuadSink* quad_sink,
AppendQuadsData* append_quads_data) OVERRIDE;
virtual ResourceProvider::ResourceId ContentsResourceId() const OVERRIDE;
- virtual void DidLoseOutputSurface() OVERRIDE;
virtual base::DictionaryValue* LayerTreeAsJson() const OVERRIDE;
@@ -56,7 +85,12 @@ class CC_EXPORT NinePatchLayerImpl : public LayerImpl {
// image space.
gfx::Rect image_aperture_;
- ResourceProvider::ResourceId resource_id_;
+ // An inset border that the patches will be mapped to.
+ gfx::Rect border_;
+
+ bool fill_center_;
+
+ UIResourceId ui_resource_id_;
DISALLOW_COPY_AND_ASSIGN(NinePatchLayerImpl);
};