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

Unified Diff: gfx/canvas_direct2d.cc

Issue 3025010: Fix transforms to be preconcat like skia so multiple transforms are accumulat... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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
« no previous file with comments | « no previous file | gfx/canvas_direct2d_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gfx/canvas_direct2d.cc
===================================================================
--- gfx/canvas_direct2d.cc (revision 53218)
+++ gfx/canvas_direct2d.cc (working copy)
@@ -117,13 +117,23 @@
}
void CanvasDirect2D::TranslateInt(int x, int y) {
- rt_->SetTransform(D2D1::Matrix3x2F::Translation(static_cast<float>(x),
- static_cast<float>(y)));
+ D2D1_MATRIX_3X2_F raw;
+ rt_->GetTransform(&raw);
+ D2D1::Matrix3x2F transform(raw._11, raw._12, raw._21, raw._22, raw._31,
+ raw._32);
+ transform = D2D1::Matrix3x2F::Translation(static_cast<float>(x),
+ static_cast<float>(y)) * transform;
+ rt_->SetTransform(transform);
}
void CanvasDirect2D::ScaleInt(int x, int y) {
- rt_->SetTransform(D2D1::Matrix3x2F::Scale(static_cast<float>(x),
- static_cast<float>(y)));
+ D2D1_MATRIX_3X2_F raw;
+ rt_->GetTransform(&raw);
+ D2D1::Matrix3x2F transform(raw._11, raw._12, raw._21, raw._22, raw._31,
+ raw._32);
+ transform = D2D1::Matrix3x2F::Scale(static_cast<float>(x),
+ static_cast<float>(y)) * transform;
+ rt_->SetTransform(transform);
}
void CanvasDirect2D::FillRectInt(int x, int y, int w, int h,
« no previous file with comments | « no previous file | gfx/canvas_direct2d_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698