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

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: 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 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 16 matching lines...) Expand all
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 "wtf/Forward.h" 35 #include "wtf/Forward.h"
36 36
37 class SkImage;
38
37 namespace blink { 39 namespace blink {
38 40
39 class FontDescription; 41 class FontDescription;
40 class Image; 42 class Image;
41 class KURL; 43 class KURL;
42 44
43 class PLATFORM_EXPORT DragImage { 45 class PLATFORM_EXPORT DragImage {
44 public: 46 public:
45 static PassOwnPtr<DragImage> create(Image*, 47 static PassOwnPtr<DragImage> create(Image*,
46 RespectImageOrientationEnum = DoNotRespectImageOrientation, float device ScaleFactor = 1, 48 RespectImageOrientationEnum = DoNotRespectImageOrientation, float device ScaleFactor = 1,
47 InterpolationQuality = InterpolationHigh, float opacity = 1, 49 InterpolationQuality = InterpolationHigh, float opacity = 1,
48 const FloatSize& imageScale = FloatSize(1, 1)); 50 FloatSize imageScale = FloatSize(1, 1));
49 51
50 static PassOwnPtr<DragImage> create(const KURL&, const String& label, const FontDescription& systemFont, float deviceScaleFactor); 52 static PassOwnPtr<DragImage> create(const KURL&, const String& label, const FontDescription& systemFont, float deviceScaleFactor);
51 ~DragImage(); 53 ~DragImage();
52 54
53 static FloatSize clampedImageScale(const Image&, const IntSize&, const IntSi ze& maxSize); 55 static FloatSize clampedImageScale(const IntSize&, const IntSize&, const Int Size& maxSize);
54 56
55 const SkBitmap& bitmap() { return m_bitmap; } 57 const SkBitmap& bitmap() { return m_bitmap; }
56 float resolutionScale() const { return m_resolutionScale; } 58 float resolutionScale() const { return m_resolutionScale; }
57 IntSize size() const { return IntSize(m_bitmap.width(), m_bitmap.height()); } 59 IntSize size() const { return IntSize(m_bitmap.width(), m_bitmap.height()); }
58 60
59 void scale(float scaleX, float scaleY); 61 void scale(float scaleX, float scaleY);
60 62
63 static PassRefPtr<SkImage> resizeAndOrientImage(PassRefPtr<SkImage>, ImageOr ientation, FloatSize imageScale = FloatSize(1, 1), float opacity = 1.0, Interpol ationQuality = InterpolationNone);
64
61 private: 65 private:
62 DragImage(const SkBitmap&, float resolutionScale, InterpolationQuality); 66 DragImage(const SkBitmap&, float resolutionScale, InterpolationQuality);
63 67
64 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); } 68 DisplayItemClient displayItemClient() const { return toDisplayItemClient(thi s); }
65 69
66 SkBitmap m_bitmap; 70 SkBitmap m_bitmap;
67 float m_resolutionScale; 71 float m_resolutionScale;
68 InterpolationQuality m_interpolationQuality; 72 InterpolationQuality m_interpolationQuality;
69 }; 73 };
70 74
71 } 75 }
72 76
73 #endif // DragImage_h 77 #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