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

Unified Diff: Source/core/paint/ImagePainter.cpp

Issue 665893004: Add paint chunk recording to ImagePainter (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 2 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/paint/ImagePainter.cpp
diff --git a/Source/core/paint/ImagePainter.cpp b/Source/core/paint/ImagePainter.cpp
index 7759ee0d2d01f4244cb032365570bc9ebedeffb8..3e0358330d12104a3c75ada8d4b82bf3dd391008 100644
--- a/Source/core/paint/ImagePainter.cpp
+++ b/Source/core/paint/ImagePainter.cpp
@@ -14,6 +14,7 @@
#include "core/inspector/InspectorInstrumentation.h"
#include "core/page/Page.h"
#include "core/paint/BoxPainter.h"
+#include "core/paint/ViewDisplayList.h"
#include "core/rendering/PaintInfo.h"
#include "core/rendering/RenderImage.h"
#include "core/rendering/RenderReplaced.h"
@@ -62,7 +63,9 @@ void ImagePainter::paintAreaElementFocusRing(PaintInfo& paintInfo)
// FIXME: Clip path instead of context when Skia pathops is ready.
// https://crbug.com/251206
GraphicsContextStateSaver savedContext(*paintInfo.context);
- paintInfo.context->clip(m_renderImage.absoluteContentBox());
+ IntRect focusRect = m_renderImage.absoluteContentBox();
+ PaintCommandRecorder recorder(paintInfo.context, &m_renderImage, paintInfo.phase, focusRect);
+ paintInfo.context->clip(focusRect);
paintInfo.context->drawFocusRing(path, outlineWidth,
areaElementStyle->outlineOffset(),
m_renderImage.resolveColor(areaElementStyle, CSSPropertyOutlineColor));
@@ -88,10 +91,12 @@ void ImagePainter::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintO
LayoutUnit topPad = m_renderImage.paddingTop();
// Draw an outline rect where the image should be.
+ IntRect paintRect = pixelSnappedIntRect(LayoutRect(paintOffset.x() + leftBorder + leftPad, paintOffset.y() + topBorder + topPad, cWidth, cHeight));
+ PaintCommandRecorder recorder(context, &m_renderImage, paintInfo.phase, paintRect);
context->setStrokeStyle(SolidStroke);
context->setStrokeColor(Color::lightGray);
context->setFillColor(Color::transparent);
- context->drawRect(pixelSnappedIntRect(LayoutRect(paintOffset.x() + leftBorder + leftPad, paintOffset.y() + topBorder + topPad, cWidth, cHeight)));
+ context->drawRect(paintRect);
bool errorPictureDrawn = false;
LayoutSize imageOffset;
@@ -153,6 +158,7 @@ void ImagePainter::paintReplaced(PaintInfo& paintInfo, const LayoutPoint& paintO
contentRect.moveBy(paintOffset);
LayoutRect paintRect = m_renderImage.replacedContentRect();
paintRect.moveBy(paintOffset);
+ PaintCommandRecorder recorder(context, &m_renderImage, paintInfo.phase, contentRect);
bool clip = !contentRect.contains(paintRect);
if (clip) {
context->save();
« 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