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

Unified Diff: Source/platform/graphics/GraphicsContext.h

Issue 323013004: Clean up transform methods in GraphicsContext. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2nd Attempt Mac build fix Created 6 years, 6 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 | « Source/platform/graphics/GradientGeneratedImage.cpp ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/GraphicsContext.h
diff --git a/Source/platform/graphics/GraphicsContext.h b/Source/platform/graphics/GraphicsContext.h
index 0fee4956284b43d0ce210bb4dfc82fb4b6ca233c..98dac271f6c91c59ebd0e9b0813a2dfe94747d30 100644
--- a/Source/platform/graphics/GraphicsContext.h
+++ b/Source/platform/graphics/GraphicsContext.h
@@ -371,20 +371,21 @@ public:
void clipOut(const Path&);
// ---------- Transformation methods -----------------
- enum IncludeDeviceScale { DefinitelyIncludeDeviceScale, PossiblyIncludeDeviceScale };
- AffineTransform getCTM(IncludeDeviceScale includeScale = PossiblyIncludeDeviceScale) const;
+ // Note that the getCTM method returns only the current transform from Blink's perspective,
+ // which is not the final transform used to place content on screen. It cannot be relied upon
+ // for testing where a point will appear on screen or how large it will be.
+ AffineTransform getCTM() const;
void concatCTM(const AffineTransform& affine) { concat(affineTransformToSkMatrix(affine)); }
void setCTM(const AffineTransform& affine) { setMatrix(affineTransformToSkMatrix(affine)); }
void setMatrix(const SkMatrix&);
- void scale(const FloatSize&);
+ void scale(float x, float y);
void rotate(float angleInRadians);
- void translate(const FloatSize& size) { translate(size.width(), size.height()); }
void translate(float x, float y);
// This function applies the device scale factor to the context, making the context capable of
// acting as a base-level context for a HiDPI environment.
- void applyDeviceScaleFactor(float deviceScaleFactor) { scale(FloatSize(deviceScaleFactor, deviceScaleFactor)); }
+ void applyDeviceScaleFactor(float deviceScaleFactor) { scale(deviceScaleFactor, deviceScaleFactor); }
// ---------- End transformation methods -----------------
// URL drawing
« no previous file with comments | « Source/platform/graphics/GradientGeneratedImage.cpp ('k') | Source/platform/graphics/GraphicsContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698