OLD | NEW |
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 Loading... |
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/SkRefCnt.h" |
35 #include "wtf/Allocator.h" | 36 #include "wtf/Allocator.h" |
36 #include "wtf/Forward.h" | 37 #include "wtf/Forward.h" |
37 #include <memory> | 38 #include <memory> |
38 | 39 |
39 class SkImage; | 40 class SkImage; |
40 | 41 |
41 namespace blink { | 42 namespace blink { |
42 | 43 |
43 class FontDescription; | 44 class FontDescription; |
44 class Image; | 45 class Image; |
(...skipping 12 matching lines...) Expand all Loading... |
57 ~DragImage(); | 58 ~DragImage(); |
58 | 59 |
59 static FloatSize clampedImageScale(const IntSize&, const IntSize&, const Int
Size& maxSize); | 60 static FloatSize clampedImageScale(const IntSize&, const IntSize&, const Int
Size& maxSize); |
60 | 61 |
61 const SkBitmap& bitmap() { return m_bitmap; } | 62 const SkBitmap& bitmap() { return m_bitmap; } |
62 float resolutionScale() const { return m_resolutionScale; } | 63 float resolutionScale() const { return m_resolutionScale; } |
63 IntSize size() const { return IntSize(m_bitmap.width(), m_bitmap.height());
} | 64 IntSize size() const { return IntSize(m_bitmap.width(), m_bitmap.height());
} |
64 | 65 |
65 void scale(float scaleX, float scaleY); | 66 void scale(float scaleX, float scaleY); |
66 | 67 |
67 static PassRefPtr<SkImage> resizeAndOrientImage(PassRefPtr<SkImage>, ImageOr
ientation, FloatSize imageScale = FloatSize(1, 1), float opacity = 1.0, Interpol
ationQuality = InterpolationNone); | 68 static sk_sp<SkImage> resizeAndOrientImage(sk_sp<SkImage>, ImageOrientation,
FloatSize imageScale = FloatSize(1, 1), float opacity = 1.0, InterpolationQuali
ty = InterpolationNone); |
68 | 69 |
69 private: | 70 private: |
70 DragImage(const SkBitmap&, float resolutionScale, InterpolationQuality); | 71 DragImage(const SkBitmap&, float resolutionScale, InterpolationQuality); |
71 | 72 |
72 SkBitmap m_bitmap; | 73 SkBitmap m_bitmap; |
73 float m_resolutionScale; | 74 float m_resolutionScale; |
74 InterpolationQuality m_interpolationQuality; | 75 InterpolationQuality m_interpolationQuality; |
75 }; | 76 }; |
76 | 77 |
77 } // namespace blink | 78 } // namespace blink |
78 | 79 |
79 #endif // DragImage_h | 80 #endif // DragImage_h |
OLD | NEW |