mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-08 19:04:45 +00:00
Bug 1767122 - Change the type of gfxWindowsNativeDrawing::mScale to MatrixScalesDouble. r=botond
Differential Revision: https://phabricator.services.mozilla.com/D148339
This commit is contained in:
parent
e76f0e14c4
commit
d4ff2f21bf
@ -124,7 +124,7 @@ HDC gfxWindowsNativeDrawing::BeginNativeDrawing() {
|
|||||||
// it would require more code that's not here.)
|
// it would require more code that's not here.)
|
||||||
if (mTransformType == TRANSLATION_ONLY ||
|
if (mTransformType == TRANSLATION_ONLY ||
|
||||||
!(mNativeDrawFlags & CAN_AXIS_ALIGNED_SCALE)) {
|
!(mNativeDrawFlags & CAN_AXIS_ALIGNED_SCALE)) {
|
||||||
mScale = gfxSize(1.0, 1.0);
|
mScale = MatrixScalesDouble();
|
||||||
|
|
||||||
// Add 1 to the surface size; it's guaranteed to not be incorrect,
|
// Add 1 to the surface size; it's guaranteed to not be incorrect,
|
||||||
// and it fixes bug 382458
|
// and it fixes bug 382458
|
||||||
@ -134,19 +134,19 @@ HDC gfxWindowsNativeDrawing::BeginNativeDrawing() {
|
|||||||
(int32_t)ceil(mNativeRect.Height() + 1));
|
(int32_t)ceil(mNativeRect.Height() + 1));
|
||||||
} else {
|
} else {
|
||||||
// figure out the scale factors
|
// figure out the scale factors
|
||||||
mScale = m.ScaleFactors().ToSize();
|
mScale = m.ScaleFactors();
|
||||||
|
|
||||||
mWorldTransform.eM11 = (FLOAT)mScale.width;
|
mWorldTransform.eM11 = (FLOAT)mScale.xScale;
|
||||||
mWorldTransform.eM12 = 0.0f;
|
mWorldTransform.eM12 = 0.0f;
|
||||||
mWorldTransform.eM21 = 0.0f;
|
mWorldTransform.eM21 = 0.0f;
|
||||||
mWorldTransform.eM22 = (FLOAT)mScale.height;
|
mWorldTransform.eM22 = (FLOAT)mScale.yScale;
|
||||||
mWorldTransform.eDx = 0.0f;
|
mWorldTransform.eDx = 0.0f;
|
||||||
mWorldTransform.eDy = 0.0f;
|
mWorldTransform.eDy = 0.0f;
|
||||||
|
|
||||||
// See comment above about "+1"
|
// See comment above about "+1"
|
||||||
mTempSurfaceSize =
|
mTempSurfaceSize =
|
||||||
IntSize((int32_t)ceil(mNativeRect.Width() * mScale.width + 1),
|
IntSize((int32_t)ceil(mNativeRect.Width() * mScale.xScale + 1),
|
||||||
(int32_t)ceil(mNativeRect.Height() * mScale.height + 1));
|
(int32_t)ceil(mNativeRect.Height() * mScale.yScale + 1));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -265,7 +265,7 @@ void gfxWindowsNativeDrawing::PaintToContext() {
|
|||||||
dt->SetTransform(newTransform);
|
dt->SetTransform(newTransform);
|
||||||
|
|
||||||
Rect rect(Point(0.0, 0.0), ToSize(mNativeRect.Size()));
|
Rect rect(Point(0.0, 0.0), ToSize(mNativeRect.Size()));
|
||||||
Matrix m = Matrix::Scaling(1.0 / mScale.width, 1.0 / mScale.height);
|
Matrix m = Matrix::Scaling(1.0 / mScale.xScale, 1.0 / mScale.yScale);
|
||||||
SurfacePattern pat(source, ExtendMode::CLAMP, m);
|
SurfacePattern pat(source, ExtendMode::CLAMP, m);
|
||||||
dt->FillRect(rect, pat);
|
dt->FillRect(rect, pat);
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ class gfxWindowsNativeDrawing {
|
|||||||
|
|
||||||
TransformType mTransformType;
|
TransformType mTransformType;
|
||||||
gfxPoint mTranslation;
|
gfxPoint mTranslation;
|
||||||
gfxSize mScale;
|
mozilla::gfx::MatrixScalesDouble mScale;
|
||||||
XFORM mWorldTransform;
|
XFORM mWorldTransform;
|
||||||
|
|
||||||
// saved state
|
// saved state
|
||||||
|
Loading…
Reference in New Issue
Block a user