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

Unified Diff: Source/platform/graphics/BitmapImage.cpp

Issue 1296543003: Use transposedSize in more places (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 4 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 | Source/platform/graphics/ImageSource.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/graphics/BitmapImage.cpp
diff --git a/Source/platform/graphics/BitmapImage.cpp b/Source/platform/graphics/BitmapImage.cpp
index f49218a73039395d4a07b235440cd70a30863cf2..4c5da02252452d84d462551b470ae78967fe727f 100644
--- a/Source/platform/graphics/BitmapImage.cpp
+++ b/Source/platform/graphics/BitmapImage.cpp
@@ -50,7 +50,7 @@ PassRefPtr<BitmapImage> BitmapImage::createWithOrientationForTesting(const SkBit
RefPtr<BitmapImage> result = adoptRef(new BitmapImage(bitmap));
result->m_frames[0].m_orientation = orientation;
if (orientation.usesWidthAsHeight())
- result->m_sizeRespectingOrientation = IntSize(result->m_size.height(), result->m_size.width());
+ result->m_sizeRespectingOrientation = result->m_size.transposedSize();
return result.release();
}
@@ -298,7 +298,7 @@ void BitmapImage::draw(SkCanvas* canvas, const SkPaint& paint, const FloatRect&
if (orientation.usesWidthAsHeight()) {
// The destination rect will have it's width and height already reversed for the orientation of
// the image, as it was needed for page layout, so we need to reverse it back here.
- adjustedDstRect = FloatRect(adjustedDstRect.x(), adjustedDstRect.y(), adjustedDstRect.height(), adjustedDstRect.width());
leviw_travelin_and_unemployed 2015/08/14 22:34:14 The old code wasn't actually a transposedRect, as
+ adjustedDstRect = adjustedDstRect.transposedRect();
}
}
« no previous file with comments | « no previous file | Source/platform/graphics/ImageSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698