Chromium Code Reviews| 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/SkImage.h" | |
| 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 |
| 61 private: | 62 private: |
| 62 DragImage(const SkBitmap&, float resolutionScale, InterpolationQuality); | 63 DragImage(const SkBitmap&, float resolutionScale, InterpolationQuality); |
| 63 | 64 |
| 64 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } | 65 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } |
| 65 | 66 |
| 66 SkBitmap m_bitmap; | 67 SkBitmap m_bitmap; |
| 67 float m_resolutionScale; | 68 float m_resolutionScale; |
| 68 InterpolationQuality m_interpolationQuality; | 69 InterpolationQuality m_interpolationQuality; |
| 69 }; | 70 }; |
| 70 | 71 |
| 72 PassRefPtr<SkImage> adjustedImage(PassRefPtr<SkImage>, const IntSize&, | |
| 73 const AffineTransform&, float opacity, InterpolationQuality = InterpolationN one); | |
|
Noel Gordon
2015/09/25 00:12:19
style: no line limit.
| |
| 74 | |
| 71 } | 75 } |
| 72 | 76 |
| 73 #endif // DragImage_h | 77 #endif // DragImage_h |
| OLD | NEW |