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

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

Issue 744163002: Enable fast/images with slimming paint (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix compile 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
Index: Source/core/paint/HTMLCanvasPainter.cpp
diff --git a/Source/core/paint/HTMLCanvasPainter.cpp b/Source/core/paint/HTMLCanvasPainter.cpp
index 71879c536ea27a806d5fd62d20d9c5e4bdeadd8b..e4ac72522478d69b04bf9aceaa3ef14dac5c5c5d 100644
--- a/Source/core/paint/HTMLCanvasPainter.cpp
+++ b/Source/core/paint/HTMLCanvasPainter.cpp
@@ -6,6 +6,8 @@
#include "core/paint/HTMLCanvasPainter.h"
#include "core/html/HTMLCanvasElement.h"
+#include "core/paint/ClipRecorder.h"
+#include "core/paint/DrawingRecorder.h"
#include "core/rendering/PaintInfo.h"
#include "core/rendering/RenderHTMLCanvas.h"
#include "platform/geometry/LayoutPoint.h"
@@ -21,12 +23,11 @@ void HTMLCanvasPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPo
LayoutRect paintRect = m_renderHTMLCanvas.replacedContentRect();
paintRect.moveBy(paintOffset);
+ PaintInfo localPaintInfo(paintInfo);
+ OwnPtr<ClipRecorder> clipRecorder;
bool clip = !contentRect.contains(paintRect);
- if (clip) {
chrishtr 2014/11/26 17:20:59 Same comment here. Shouldn't we just be allocating
chrishtr 2014/11/26 18:34:15 Hmm. Maybe in this case, separating the clip is ne
leviw_travelin_and_unemployed 2014/11/26 18:39:08 RenderReplaced and its ilk don't get child rendere
- // Not allowed to overflow the content box.
- paintInfo.context->save();
- paintInfo.context->clip(pixelSnappedIntRect(contentRect));
- }
+ if (clip)
+ clipRecorder = adoptPtr(new ClipRecorder(m_renderHTMLCanvas, paintInfo, contentRect));
// FIXME: InterpolationNone should be used if ImageRenderingOptimizeContrast is set.
// See bug for more details: crbug.com/353716.
@@ -39,13 +40,11 @@ void HTMLCanvasPainter::paintReplaced(const PaintInfo& paintInfo, const LayoutPo
interpolationQuality = InterpolationNone;
}
+ DrawingRecorder recorder(context, &m_renderHTMLCanvas, localPaintInfo.phase, pixelSnappedIntRect(paintRect));
InterpolationQuality previousInterpolationQuality = context->imageInterpolationQuality();
context->setImageInterpolationQuality(interpolationQuality);
canvas->paint(context, paintRect);
context->setImageInterpolationQuality(previousInterpolationQuality);
-
- if (clip)
- context->restore();
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698