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

Unified Diff: third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp

Issue 1361413004: Fix directly composited image path for CSS image-orientation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 5 years, 2 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 | « third_party/WebKit/Source/platform/graphics/GraphicsLayer.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 13e59ebddaea9bb22293b314846e6c46c4b034bf..21f225a6b10ccf0622d76da6c59e1f248f62dedd 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -28,9 +28,11 @@
#include "SkImageFilter.h"
#include "SkMatrix44.h"
+#include "platform/DragImage.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"
@@ -1044,7 +1046,7 @@ void GraphicsLayer::setContentsRect(const IntRect& rect)
updateContentsRect();
}
-void GraphicsLayer::setContentsToImage(Image* image)
+void GraphicsLayer::setContentsToImage(Image* image, RespectImageOrientationEnum respectImageOrientation)
{
RefPtr<SkImage> skImage = image ? image->imageForCurrentFrame() : nullptr;
if (image && skImage) {
@@ -1052,6 +1054,10 @@ void GraphicsLayer::setContentsToImage(Image* image)
m_imageLayer = adoptPtr(Platform::current()->compositorSupport()->createImageLayer());
registerContentsLayer(m_imageLayer->layer());
}
+ if (respectImageOrientation == RespectImageOrientation && image->isBitmapImage()) {
+ ImageOrientation imageOrientation = toBitmapImage(image)->currentFrameOrientation();
+ skImage = DragImage::resizeAndOrientImage(skImage.release(), imageOrientation);
+ }
m_imageLayer->setImage(skImage.get());
m_imageLayer->layer()->setOpaque(image->currentFrameKnownToBeOpaque());
updateContentsRect();
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/GraphicsLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698