Changeset 147110 in webkit
- Timestamp:
- Mar 28, 2013 7:04:13 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r147109 r147110 1 2013-03-28 Chris Hutten-Czapski <chutten@blackberry.com> 2 3 [BlackBerry] Handle EXIF orientation for ImageDocuments 4 https://bugs.webkit.org/show_bug.cgi?id=113423 5 6 Internal Bug: PR 293648 7 Informally Reviewed by Jeff Rogers 8 Reviewed by Rob Buis. 9 10 Support image orientation in our image draw calls, and advertise 11 the capability to the calling code. This allows us to respect EXIF 12 orientation data. 13 14 * platform/graphics/BitmapImage.h: 15 * platform/graphics/blackberry/ImageBlackBerry.cpp: 16 (WebCore::BitmapImage::draw): 17 (WebCore): 18 * rendering/RenderObject.cpp: 19 (WebCore::RenderObject::shouldRespectImageOrientation): 20 1 21 2013-03-28 Andrey Kosyakov <caseq@chromium.org> 2 22 -
trunk/Source/WebCore/platform/graphics/BitmapImage.h
r141637 r147110 209 209 #endif 210 210 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode); 211 #if USE(CG) || PLATFORM(CHROMIUM) || USE(CAIRO) 211 #if USE(CG) || PLATFORM(CHROMIUM) || USE(CAIRO) || PLATFORM(BLACKBERRY) 212 212 virtual void draw(GraphicsContext*, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator, BlendMode, RespectImageOrientationEnum) OVERRIDE; 213 213 #endif -
trunk/Source/WebCore/platform/graphics/blackberry/ImageBlackBerry.cpp
r145550 r147110 122 122 void BitmapImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator op, BlendMode blendMode) 123 123 { 124 draw(context, dstRect, srcRect, styleColorSpace, op, DoNotRespectImageOrientation); 125 } 126 127 void BitmapImage::draw(GraphicsContext* context, const FloatRect& dstRect, const FloatRect& srcRect, ColorSpace styleColorSpace, CompositeOperator op, RespectImageOrientationEnum shouldRespectImageOrientation) 128 { 124 129 startAnimation(); 125 130 … … 137 142 normSrcRect = adjustSourceRectForDownSampling(normSrcRect, image->size()); 138 143 #endif 144 145 // use similar orientation code as ImageSkia 146 ImageOrientation orientation = DefaultImageOrientation; 147 if (shouldRespectImageOrientation == RespectImageOrientation) 148 orientation = frameOrientationAtIndex(m_currentFrame); 149 150 GraphicsContextStateSaver saveContext(*context, false); 151 if (orientation != DefaultImageOrientation) { 152 saveContext.save(); 153 154 // ImageOrientation expects the origin to be at (0, 0) 155 context->translate(normDstRect.x(), normDstRect.y()); 156 normDstRect.setLocation(FloatPoint()); 157 158 context->concatCTM(orientation.transformFromDefault(normDstRect.size())); 159 if (orientation.usesWidthAsHeight()) { 160 // The destination rect will have its width and height already reversed for the orientation of 161 // the image, as it was needed for page layout, so we need to reverse it back here. 162 normDstRect = FloatRect(normDstRect.x(), normDstRect.y(), normDstRect.height(), normDstRect.width()); 163 } 164 } 139 165 140 166 CompositeOperator oldOperator = context->compositeOperation(); -
trunk/Source/WebCore/rendering/RenderObject.cpp
r146856 r147110 2290 2290 // an <img> and the setting to respect it everywhere is set. 2291 2291 return 2292 #if USE(CG) || PLATFORM(CHROMIUM) || USE(CAIRO) 2292 #if USE(CG) || PLATFORM(CHROMIUM) || USE(CAIRO) || PLATFORM(BLACKBERRY) 2293 2293 // This can only be enabled for ports which honor the orientation flag in their drawing code. 2294 2294 document()->isImageDocument() ||
Note: See TracChangeset
for help on using the changeset viewer.