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

Unified Diff: cc/layers/nine_patch_layer_impl.h

Issue 1889153002: cc: nine patch: add occlusion support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: final nits Created 4 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 side-by-side diff with in-line comments
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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/nine_patch_layer_impl.h
diff --git a/cc/layers/nine_patch_layer_impl.h b/cc/layers/nine_patch_layer_impl.h
index 1fe8e7f2a39eef00adcde12f0c688b94f23185d5..3511c3219138dfe4d88a4e5177c0c7ac85fe1f02 100644
--- a/cc/layers/nine_patch_layer_impl.h
+++ b/cc/layers/nine_patch_layer_impl.h
@@ -34,29 +34,52 @@ class CC_EXPORT NinePatchLayerImpl : public UIResourceLayerImpl {
// 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
+ // Layer space layout
//
- // ------------------------ ~~~~~~~~~~ W ~~~~~~~~~~
- // | : | : : |
- // | C | : Y |
- // | : | : : |
- // | ------------ | :~~X~~------------ |
- // | | | | : | : |
- // | | | | : | : |
- // |~~A~~| |~~B~~| H | Q |
- // | | | | : | : |
- // | ------------ | : ~~~~~P~~~~~ |
- // | : | : |
- // | D | : |
- // | : | : |
- // ------------------------ ------------------------
+ // --------------------------------
+ // | : : |
+ // | J C |
+ // | : : |
+ // | ------------------ |
+ // | | : | |
+ // |~~~I~~| ------------ | |
+ // | | | | | |
+ // | | | | | |
+ // |~~~A~~|~~| |~~|~B~~~~|
+ // | | | | | |
+ // | L ------------ | |
+ // | | : | |
+ // | ---K-------------- |
+ // | D |
+ // | : |
+ // | : |
+ // --------------------------------
+ //
+ // Bitmap space layout
+ //
+ // ~~~~~~~~~~ W ~~~~~~~~~~
+ // : : |
+ // : Y |
+ // : : |
+ // :~~X~~------------ |
+ // : | : |
+ // : | : |
+ // H | Q |
+ // : | : |
+ // : ~~~~~P~~~~~ |
+ // : |
+ // : |
+ // : |
+ // ------------------------
//
// |image_bounds| = (W, H)
// |image_aperture| = (X, Y, P, Q)
// |border| = (A, C, A + B, C + D)
+ // |occlusion_rectangle| = (I, J, K, L)
// |fill_center| indicates whether to draw the center quad or not.
void SetLayout(const gfx::Rect& image_aperture,
const gfx::Rect& border,
+ const gfx::Rect& layer_occlusion,
bool fill_center,
bool nearest_neighbor);
@@ -72,10 +95,21 @@ class CC_EXPORT NinePatchLayerImpl : public UIResourceLayerImpl {
NinePatchLayerImpl(LayerTreeImpl* tree_impl, int id);
private:
+ class Patch {
+ public:
+ Patch(const gfx::Rect& image_rect, const gfx::Rect& layer_rect);
+
+ gfx::Rect image_rect;
+ gfx::Rect layer_rect;
+ };
+
const char* LayerTypeAsString() const override;
void CheckGeometryLimitations();
+ std::vector<Patch> ComputeQuadsWithOcclusion() const;
+ std::vector<Patch> ComputeQuadsWithoutOcclusion() const;
+
// The transparent center region that shows the parent layer's contents in
// image space.
gfx::Rect image_aperture_;
@@ -87,6 +121,8 @@ class CC_EXPORT NinePatchLayerImpl : public UIResourceLayerImpl {
bool nearest_neighbor_;
+ gfx::Rect layer_occlusion_;
+
DISALLOW_COPY_AND_ASSIGN(NinePatchLayerImpl);
};
« 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