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

Side by Side Diff: cc/layers/nine_patch_layer_impl.h

Issue 1057283003: Remove parts of //cc we aren't using (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 8 months 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
« no previous file with comments | « cc/layers/nine_patch_layer.cc ('k') | cc/layers/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
(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 CC_LAYERS_NINE_PATCH_LAYER_IMPL_H_
6 #define CC_LAYERS_NINE_PATCH_LAYER_IMPL_H_
7
8 #include <string>
9
10 #include "cc/base/cc_export.h"
11 #include "cc/layers/layer_impl.h"
12 #include "cc/layers/ui_resource_layer_impl.h"
13 #include "cc/resources/resource_provider.h"
14 #include "cc/resources/ui_resource_client.h"
15 #include "ui/gfx/geometry/rect.h"
16 #include "ui/gfx/geometry/size.h"
17
18 namespace base {
19 class DictionaryValue;
20 }
21
22 namespace cc {
23
24 class CC_EXPORT NinePatchLayerImpl : public UIResourceLayerImpl {
25 public:
26 static scoped_ptr<NinePatchLayerImpl> Create(LayerTreeImpl* tree_impl,
27 int id) {
28 return make_scoped_ptr(new NinePatchLayerImpl(tree_impl, id));
29 }
30 ~NinePatchLayerImpl() override;
31
32 // The bitmap stretches out the bounds of the layer. The following picture
33 // illustrates the parameters associated with the dimensions.
34 //
35 // Layer space layout Bitmap space layout
36 //
37 // ------------------------ ~~~~~~~~~~ W ~~~~~~~~~~
38 // | : | : : |
39 // | C | : Y |
40 // | : | : : |
41 // | ------------ | :~~X~~------------ |
42 // | | | | : | : |
43 // | | | | : | : |
44 // |~~A~~| |~~B~~| H | Q |
45 // | | | | : | : |
46 // | ------------ | : ~~~~~P~~~~~ |
47 // | : | : |
48 // | D | : |
49 // | : | : |
50 // ------------------------ ------------------------
51 //
52 // |image_bounds| = (W, H)
53 // |image_aperture| = (X, Y, P, Q)
54 // |border| = (A, C, A + B, C + D)
55 // |fill_center| indicates whether to draw the center quad or not.
56 void SetLayout(const gfx::Rect& image_aperture,
57 const gfx::Rect& border,
58 bool fill_center);
59
60 scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
61 void PushPropertiesTo(LayerImpl* layer) override;
62
63 void AppendQuads(RenderPass* render_pass,
64 AppendQuadsData* append_quads_data) override;
65
66 base::DictionaryValue* LayerTreeAsJson() const override;
67
68 protected:
69 NinePatchLayerImpl(LayerTreeImpl* tree_impl, int id);
70
71 private:
72 const char* LayerTypeAsString() const override;
73
74 void CheckGeometryLimitations();
75
76 // The transparent center region that shows the parent layer's contents in
77 // image space.
78 gfx::Rect image_aperture_;
79
80 // An inset border that the patches will be mapped to.
81 gfx::Rect border_;
82
83 bool fill_center_;
84
85 DISALLOW_COPY_AND_ASSIGN(NinePatchLayerImpl);
86 };
87
88 } // namespace cc
89
90 #endif // CC_LAYERS_NINE_PATCH_LAYER_IMPL_H_
OLDNEW
« no previous file with comments | « cc/layers/nine_patch_layer.cc ('k') | cc/layers/nine_patch_layer_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698