diff options
author | yfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-12 18:02:59 +0000 |
---|---|---|
committer | yfriedman@chromium.org <yfriedman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-09-12 18:02:59 +0000 |
commit | 1152878dbe41fcfea67d49144170b65695f5c0e1 (patch) | |
tree | 9bc16be8b52421b5d8db91b72d0aebd9b7106aa0 /cc/layers/nine_patch_layer_impl.h | |
parent | 4a7dbbe9e9d675dbf3ab47878d16cce23c26e8da (diff) | |
download | chromium_src-1152878dbe41fcfea67d49144170b65695f5c0e1.zip chromium_src-1152878dbe41fcfea67d49144170b65695f5c0e1.tar.gz chromium_src-1152878dbe41fcfea67d49144170b65695f5c0e1.tar.bz2 |
Revert 222732 "Update the nine patch layer to use UI resources"
> Update the nine patch layer to use UI resources
>
> The old nine-patch layer used priority resource manager for requesting textures.
> This patch updates the nine-patch layer to use the UI resource manager.
> this patch clarifies the semantics of the aperture in both image and layer
> The new semantics corresponds to existing logic on the android-side.
>
> Changes have been made to UIResourceBitmap to use SkPixelRef as ref-counted
> of the bitmap content.
>
> The android-side changes:
> https://gerrit-int.chromium.org/#/c/43103/
>
> BUG=276482,276487
>
> Review URL: https://chromiumcodereview.appspot.com/22870016
TBR=powei@chromium.org
Review URL: https://codereview.chromium.org/23620047
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@222808 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cc/layers/nine_patch_layer_impl.h')
-rw-r--r-- | cc/layers/nine_patch_layer_impl.h | 42 |
1 files changed, 4 insertions, 38 deletions
diff --git a/cc/layers/nine_patch_layer_impl.h b/cc/layers/nine_patch_layer_impl.h index ba414ae..bc442d4 100644 --- a/cc/layers/nine_patch_layer_impl.h +++ b/cc/layers/nine_patch_layer_impl.h @@ -10,7 +10,6 @@ #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" @@ -28,37 +27,8 @@ class CC_EXPORT NinePatchLayerImpl : public LayerImpl { } virtual ~NinePatchLayerImpl(); - - 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); + void SetResourceId(unsigned id) { resource_id_ = id; } + void SetLayout(gfx::Size image_bounds, gfx::Rect aperture); virtual scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) OVERRIDE; @@ -69,6 +39,7 @@ 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; @@ -85,12 +56,7 @@ class CC_EXPORT NinePatchLayerImpl : public LayerImpl { // image space. gfx::Rect image_aperture_; - // An inset border that the patches will be mapped to. - gfx::Rect border_; - - bool fill_center_; - - UIResourceId ui_resource_id_; + ResourceProvider::ResourceId resource_id_; DISALLOW_COPY_AND_ASSIGN(NinePatchLayerImpl); }; |