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

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: sky & aelias' changes 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
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 539d8e717aed319b6c88bfc6c1e73f727b3a9308..a9f989c9bcd30a0fcc85b683e784bee44ba41866 100644
--- a/cc/layers/nine_patch_layer_impl.h
+++ b/cc/layers/nine_patch_layer_impl.h
@@ -33,31 +33,54 @@ 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)
// |fill_center| indicates whether to draw the center quad or not.
+ // |occlusion_rectangle| = (I, J, K, L)
void SetLayout(const gfx::Rect& image_aperture,
const gfx::Rect& border,
bool fill_center,
- bool nearest_neighbor);
+ bool nearest_neighbor,
+ const gfx::Rect& layer_occlusion);
aelias_OOO_until_Jul13 2016/04/22 03:00:42 Please move this next to image_aperture in the arg
llandwerlin-old 2016/04/22 13:46:10 Done.
scoped_ptr<LayerImpl> CreateLayerImpl(LayerTreeImpl* tree_impl) override;
void PushPropertiesTo(LayerImpl* layer) override;
@@ -75,6 +98,11 @@ class CC_EXPORT NinePatchLayerImpl : public UIResourceLayerImpl {
void CheckGeometryLimitations();
+ void ComputeQuadsWithOcclusion(std::vector<gfx::Rect>* image_rects,
+ std::vector<gfx::Rect>* layer_rects) const;
aelias_OOO_until_Jul13 2016/04/22 03:00:42 I think this pointer stuff should be avoided as fo
llandwerlin-old 2016/04/22 13:46:10 Done.
+ void ComputeQuadsWithoutOcclusion(std::vector<gfx::Rect>* image_rects,
+ std::vector<gfx::Rect>* layer_rects) const;
+
// The transparent center region that shows the parent layer's contents in
// image space.
gfx::Rect image_aperture_;
@@ -86,6 +114,8 @@ class CC_EXPORT NinePatchLayerImpl : public UIResourceLayerImpl {
bool nearest_neighbor_;
+ gfx::Rect layer_occlusion_;
+
DISALLOW_COPY_AND_ASSIGN(NinePatchLayerImpl);
};

Powered by Google App Engine
This is Rietveld 408576698