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

Unified Diff: sky/engine/core/dom/Element.cpp

Issue 1144673002: Make it possible to Paint elements into a display list. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Add example Created 5 years, 7 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 | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Element.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/dom/Element.cpp
diff --git a/sky/engine/core/dom/Element.cpp b/sky/engine/core/dom/Element.cpp
index c6452401ce22d976196de8cb296406c52febfc17..61ac9eaa38ed11b280c34b84bfc7327bbe0c1dc8 100644
--- a/sky/engine/core/dom/Element.cpp
+++ b/sky/engine/core/dom/Element.cpp
@@ -78,6 +78,7 @@
#include "sky/engine/core/page/Page.h"
#include "sky/engine/core/painting/PaintingCallback.h"
#include "sky/engine/core/painting/PaintingTasks.h"
+#include "sky/engine/core/painting/PictureRecorder.h"
#include "sky/engine/core/rendering/RenderCustomLayout.h"
#include "sky/engine/core/rendering/RenderLayer.h"
#include "sky/engine/core/rendering/RenderView.h"
@@ -1685,4 +1686,18 @@ bool Element::affectedByIdSelector(const AtomicString& idValue) const
return false;
}
+void Element::paint(PictureRecorder* recorder)
+{
+ if (!renderer() || !renderer()->isBox())
+ return;
+ RenderBox* box = toRenderBox(renderer());
+ GraphicsContext context(recorder->skCanvas());
+
+ // Very simplified painting to allow painting an arbitrary (layer-less) subtree.
+ Vector<RenderBox*> layers;
+ PaintInfo paintInfo(&context, box->absoluteBoundingBoxRect(), box);
+ box->paint(paintInfo, LayoutPoint(), layers);
+ // Note we're ignoring any layers encountered.
+}
+
} // namespace blink
« no previous file with comments | « sky/engine/core/dom/Element.h ('k') | sky/engine/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698