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

Unified Diff: third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp

Issue 2104103003: Fix zoom in CSS paint worklets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2nd rebase Created 4 years, 5 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: third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp
diff --git a/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp b/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp
index 19884e3b066d248a2f78802413eb28bdc12dbaa5..28f6a81c44c8cde7007e7c5e8b02215f1dd744f5 100644
--- a/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp
+++ b/third_party/WebKit/Source/modules/csspaint/PaintRenderingContext2D.cpp
@@ -9,17 +9,18 @@
namespace blink {
-PaintRenderingContext2D::PaintRenderingContext2D(std::unique_ptr<ImageBuffer> imageBuffer, bool hasAlpha)
+PaintRenderingContext2D::PaintRenderingContext2D(std::unique_ptr<ImageBuffer> imageBuffer, bool hasAlpha, float zoom)
: m_imageBuffer(std::move(imageBuffer)), m_hasAlpha(hasAlpha)
{
m_clipAntialiasing = AntiAliased;
modifiableState().setShouldAntialias(true);
-
// RecordingImageBufferSurface doesn't call ImageBufferSurface::clear explicitly.
DCHECK(m_imageBuffer);
m_imageBuffer->canvas()->clear(hasAlpha ? SK_ColorTRANSPARENT : SK_ColorBLACK);
m_imageBuffer->didDraw(FloatRect(0, 0, width(), height()));
+
+ m_imageBuffer->canvas()->scale(zoom, zoom);
}
int PaintRenderingContext2D::width() const

Powered by Google App Engine
This is Rietveld 408576698