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

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

Issue 877553011: Unit test for non-default orientation images which don't produce pixels. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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/BitmapImage.h ('k') | no next file » | 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 74a69778c19efa716f4ab7dd6d08ac4a117b6fc3..7d674be144ce55f8f30640e5829cd16dfc5706e2 100644
--- a/Source/platform/graphics/BitmapImage.cpp
+++ b/Source/platform/graphics/BitmapImage.cpp
@@ -48,6 +48,15 @@ PassRefPtr<BitmapImage> BitmapImage::create(PassRefPtr<NativeImageSkia> nativeIm
return adoptRef(new BitmapImage(nativeImage, observer));
}
+PassRefPtr<BitmapImage> BitmapImage::createWithOrientationForTesting(PassRefPtr<NativeImageSkia> nativeImage, ImageOrientation orientation)
+{
+ RefPtr<BitmapImage> result = create(nativeImage);
+ result->m_frames[0].m_orientation = orientation;
+ if (orientation.usesWidthAsHeight())
+ result->m_sizeRespectingOrientation = IntSize(result->m_size.height(), result->m_size.width());
+ return result.release();
+}
+
BitmapImage::BitmapImage(ImageObserver* observer)
: Image(observer)
, m_currentFrame(0)
« no previous file with comments | « Source/platform/graphics/BitmapImage.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698