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

Side by Side Diff: third_party/WebKit/Source/platform/DragImage.h

Issue 1361413004: Fix directly composited image path for CSS image-orientation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 14 matching lines...) Expand all
25 25
26 #ifndef DragImage_h 26 #ifndef DragImage_h
27 #define DragImage_h 27 #define DragImage_h
28 28
29 #include "platform/geometry/FloatSize.h" 29 #include "platform/geometry/FloatSize.h"
30 #include "platform/geometry/IntSize.h" 30 #include "platform/geometry/IntSize.h"
31 #include "platform/graphics/GraphicsTypes.h" 31 #include "platform/graphics/GraphicsTypes.h"
32 #include "platform/graphics/ImageOrientation.h" 32 #include "platform/graphics/ImageOrientation.h"
33 #include "platform/graphics/paint/DisplayItemClient.h" 33 #include "platform/graphics/paint/DisplayItemClient.h"
34 #include "third_party/skia/include/core/SkBitmap.h" 34 #include "third_party/skia/include/core/SkBitmap.h"
35 #include "third_party/skia/include/core/SkImage.h"
chrishtr 2015/10/05 23:19:47 Instead of #include, forward-declare SkImage.
35 #include "wtf/Forward.h" 36 #include "wtf/Forward.h"
36 37
37 namespace blink { 38 namespace blink {
38 39
39 class FontDescription; 40 class FontDescription;
40 class Image; 41 class Image;
41 class KURL; 42 class KURL;
42 43
43 class PLATFORM_EXPORT DragImage { 44 class PLATFORM_EXPORT DragImage {
44 public: 45 public:
45 static PassOwnPtr<DragImage> create(Image*, 46 static PassOwnPtr<DragImage> create(Image*,
46 RespectImageOrientationEnum = DoNotRespectImageOrientation, float device ScaleFactor = 1, 47 RespectImageOrientationEnum = DoNotRespectImageOrientation, float device ScaleFactor = 1,
47 InterpolationQuality = InterpolationHigh, float opacity = 1, 48 InterpolationQuality = InterpolationHigh, float opacity = 1,
48 const FloatSize& imageScale = FloatSize(1, 1)); 49 FloatSize imageScale = FloatSize(1, 1));
49 50
50 static PassOwnPtr<DragImage> create(const KURL&, const String& label, const FontDescription& systemFont, float deviceScaleFactor); 51 static PassOwnPtr<DragImage> create(const KURL&, const String& label, const FontDescription& systemFont, float deviceScaleFactor);
51 ~DragImage(); 52 ~DragImage();
52 53
53 static FloatSize clampedImageScale(const Image&, const IntSize&, const IntSi ze& maxSize); 54 static FloatSize clampedImageScale(const IntSize&, const IntSize&, const Int Size& maxSize);
54 55
55 const SkBitmap& bitmap() { return m_bitmap; } 56 const SkBitmap& bitmap() { return m_bitmap; }
56 float resolutionScale() const { return m_resolutionScale; } 57 float resolutionScale() const { return m_resolutionScale; }
57 IntSize size() const { return IntSize(m_bitmap.width(), m_bitmap.height()); } 58 IntSize size() const { return IntSize(m_bitmap.width(), m_bitmap.height()); }
58 59
59 void scale(float scaleX, float scaleY); 60 void scale(float scaleX, float scaleY);
60 61
62 static PassRefPtr<SkImage> resizeAndOrientImage(PassRefPtr<SkImage>, ImageOr ientation, FloatSize imageScale = FloatSize(1, 1), float opacity = 1.0, Interpol ationQuality = InterpolationNone);
63
61 private: 64 private:
62 DragImage(const SkBitmap&, float resolutionScale, InterpolationQuality); 65 DragImage(const SkBitmap&, float resolutionScale, InterpolationQuality);
63 66
64 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } 67 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); }
65 68
66 SkBitmap m_bitmap; 69 SkBitmap m_bitmap;
67 float m_resolutionScale; 70 float m_resolutionScale;
68 InterpolationQuality m_interpolationQuality; 71 InterpolationQuality m_interpolationQuality;
69 }; 72 };
70 73
71 } 74 }
72 75
73 #endif // DragImage_h 76 #endif // DragImage_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/page/DragController.cpp ('k') | third_party/WebKit/Source/platform/DragImage.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698