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

Unified Diff: sky/specs/style.md

Issue 734763002: Specs: lay groundwork for scrolling widget (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/specs/style.md
diff --git a/sky/specs/style.md b/sky/specs/style.md
index c3d6c8c4ea521cd892312d1387e332fa3e103603..fd3008c553f76e0137bbe8f8546c42dfdeda945d 100644
--- a/sky/specs/style.md
+++ b/sky/specs/style.md
@@ -343,6 +343,7 @@ node's layoutManager and ownerLayoutManager attributes to null.
// using walkChildren() does this for you
readonly attribute Boolean needsPaint; // means that either needsLayout is true or a property with needsPaint:true has changed on this node or one of its descendants
+ // needsPaint is set to false by the ownerLayoutManager's default paint() method
// only the ownerLayoutManager can change these
readonly attribute Float x; // relative to left edge of ownerLayoutManager
@@ -435,15 +436,18 @@ Layout managers inherit from the following API:
// the return value should include the final value for whichever of the width and height arguments that is null
// TODO(ianh): should we just grab the width and height from assumeDimensions()?
- void paint(RenderingSurface canvas);
+ void markAsPainted(); // sets this.node.needsPaint to false
+ virtual void paint(RenderingSurface canvas);
// set a clip rect on the canvas for rect(0,0,this.width,this.height)
// call the painter of each property, in order they were registered, which on this element has a painter
// call this.paintChildren()
// unset the clip
+ // call markAsPainted()
virtual void paintChildren(RenderingSurface canvas);
// just calls paint() for each child returned by walkChildren() whose needsPaint is true,
// after transforming the coordinate space by translate(child.x,child.y)
+ // you should skip children that will be clipped out of yourself because they're outside your bounds
virtual Node hitTest(Float x, Float y);
// default implementation uses the node's children nodes' x, y,
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698