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

Unified Diff: sky/engine/core/rendering/RenderBox.cpp

Issue 1122423009: Make it possible to custom-paint without an Element. (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Comment tweak 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
Index: sky/engine/core/rendering/RenderBox.cpp
diff --git a/sky/engine/core/rendering/RenderBox.cpp b/sky/engine/core/rendering/RenderBox.cpp
index 59acacea1dcec48cc0d953072615bd69f7344d5b..c7d70da18919727a3a876f49f452242438096332 100644
--- a/sky/engine/core/rendering/RenderBox.cpp
+++ b/sky/engine/core/rendering/RenderBox.cpp
@@ -994,19 +994,24 @@ BackgroundBleedAvoidance RenderBox::determineBackgroundBleedAvoidance(GraphicsCo
return BackgroundBleedClipBackground;
}
-void RenderBox::paintBoxDecorationBackground(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+void RenderBox::paintCustomPainting(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
{
LayoutRect paintRect = borderBoxRect();
paintRect.moveBy(paintOffset);
- paintBoxDecorationBackgroundWithRect(paintInfo, paintOffset, paintRect);
// TODO(abarth): Currently we only draw m_customPainting if we happen to
- // have a box decoration or a background. Instead, we should probably have
- // another function like paintBoxDecorationBackground that subclasses can
- // call to draw m_customPainting.
+ // have a box decoration or a background.
if (m_customPainting)
paintInfo.context->drawDisplayList(m_customPainting.get(), paintRect.location());
}
+void RenderBox::paintBoxDecorationBackground(PaintInfo& paintInfo, const LayoutPoint& paintOffset)
+{
+ LayoutRect paintRect = borderBoxRect();
+ paintRect.moveBy(paintOffset);
+ paintBoxDecorationBackgroundWithRect(paintInfo, paintOffset, paintRect);
+ paintCustomPainting(paintInfo, paintOffset);
+}
+
void RenderBox::paintBoxDecorationBackgroundWithRect(PaintInfo& paintInfo, const LayoutPoint& paintOffset, const LayoutRect& paintRect)
{
RenderStyle* style = this->style();

Powered by Google App Engine
This is Rietveld 408576698