Chromium Code Reviews| Index: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
| diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
| index 5e2559191ccd7b1613bc104f5c63c2d22a932cc9..9bf96db9fbc2d7060e4a42ff92e03c68aa41d4f9 100644 |
| --- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
| +++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp |
| @@ -28,9 +28,12 @@ |
| #include "SkImageFilter.h" |
| #include "SkMatrix44.h" |
| +#include "platform/DragImage.h" |
| +#include "platform/RuntimeEnabledFeatures.h" |
| #include "platform/TraceEvent.h" |
| #include "platform/geometry/FloatRect.h" |
| #include "platform/geometry/LayoutRect.h" |
| +#include "platform/graphics/BitmapImage.h" |
| #include "platform/graphics/FirstPaintInvalidationTracking.h" |
| #include "platform/graphics/GraphicsContext.h" |
| #include "platform/graphics/GraphicsLayerFactory.h" |
| @@ -1014,6 +1017,12 @@ void GraphicsLayer::setContentsToImage(Image* image) |
| m_imageLayer = adoptPtr(Platform::current()->compositorSupport()->createImageLayer()); |
| registerContentsLayer(m_imageLayer->layer()); |
| } |
| + if (RuntimeEnabledFeatures::imageOrientationEnabled() && image->isBitmapImage()) { |
| + ImageOrientation imageOrientation = static_cast<BitmapImage*>(image)->currentFrameOrientation(); |
|
Noel Gordon
2015/09/25 00:12:19
Let's avoid the static cast: we could for example
|
| + bool usesWidthAsHeight = imageOrientation.usesWidthAsHeight(); |
| + IntSize size = usesWidthAsHeight ? image->size().transposedSize() : image->size(); |
| + skImage = adjustedImage(skImage.release(), size, imageOrientation.transformFromDefault(size), 1.0f); |
| + } |
| m_imageLayer->setImage(skImage.get()); |
| m_imageLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque()); |
| updateContentsRect(); |