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

Side by Side Diff: Source/platform/graphics/skia/NativeImageSkia.h

Issue 99103006: Moving GraphicsContext and dependencies from core to platform. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Final patch - fixes Android Created 7 years 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2008, Google Inc. All rights reserved. 2 * Copyright (c) 2008, Google 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 are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 17 matching lines...) Expand all
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef NativeImageSkia_h 31 #ifndef NativeImageSkia_h
32 #define NativeImageSkia_h 32 #define NativeImageSkia_h
33 33
34 #include "SkBitmap.h" 34 #include "SkBitmap.h"
35 #include "SkRect.h" 35 #include "SkRect.h"
36 #include "SkSize.h" 36 #include "SkSize.h"
37 #include "SkXfermode.h" 37 #include "SkXfermode.h"
38 #include "platform/PlatformExport.h"
38 #include "platform/geometry/IntSize.h" 39 #include "platform/geometry/IntSize.h"
39 #include "platform/graphics/GraphicsTypes.h" 40 #include "platform/graphics/GraphicsTypes.h"
40 #include "wtf/Forward.h" 41 #include "wtf/Forward.h"
41 #include "wtf/PassRefPtr.h" 42 #include "wtf/PassRefPtr.h"
42 #include "wtf/RefCounted.h" 43 #include "wtf/RefCounted.h"
43 44
44 class SkMatrix; 45 class SkMatrix;
45 class SkPaint; 46 class SkPaint;
46 47
47 namespace WebCore { 48 namespace WebCore {
(...skipping 13 matching lines...) Expand all
61 // quality resampling doesn't get us very much except a slowdown. 62 // quality resampling doesn't get us very much except a slowdown.
62 LinearResampling, 63 LinearResampling,
63 64
64 // High quality resampling. 65 // High quality resampling.
65 AwesomeResampling, 66 AwesomeResampling,
66 }; 67 };
67 68
68 // This object is used as the "native image" in our port. When WebKit uses 69 // This object is used as the "native image" in our port. When WebKit uses
69 // PassNativeImagePtr / NativeImagePtr, it is a smart pointer to this type. 70 // PassNativeImagePtr / NativeImagePtr, it is a smart pointer to this type.
70 // It has an SkBitmap, and also stores a cached resized image. 71 // It has an SkBitmap, and also stores a cached resized image.
71 class NativeImageSkia : public RefCounted<NativeImageSkia> { 72 class PLATFORM_EXPORT NativeImageSkia : public RefCounted<NativeImageSkia> {
72 public: 73 public:
73 static PassRefPtr<NativeImageSkia> create() 74 static PassRefPtr<NativeImageSkia> create()
74 { 75 {
75 return adoptRef(new NativeImageSkia()); 76 return adoptRef(new NativeImageSkia());
76 } 77 }
77 78
78 // This factory method does a shallow copy of the passed-in SkBitmap 79 // This factory method does a shallow copy of the passed-in SkBitmap
79 // (ie., it references the same pixel data and bumps the refcount). Use 80 // (ie., it references the same pixel data and bumps the refcount). Use
80 // only when you want sharing semantics. 81 // only when you want sharing semantics.
81 static PassRefPtr<NativeImageSkia> create(const SkBitmap& bitmap, float reso lutionScale = 1) 82 static PassRefPtr<NativeImageSkia> create(const SkBitmap& bitmap, float reso lutionScale = 1)
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 // those requests individually are small and would not otherwise be cached. 199 // those requests individually are small and would not otherwise be cached.
199 // 200 //
200 // We also track scaling information and destination subset for the scaled 201 // We also track scaling information and destination subset for the scaled
201 // image. See comments for ImageResourceInfo. 202 // image. See comments for ImageResourceInfo.
202 mutable ImageResourceInfo m_cachedImageInfo; 203 mutable ImageResourceInfo m_cachedImageInfo;
203 mutable int m_resizeRequests; 204 mutable int m_resizeRequests;
204 }; 205 };
205 206
206 } 207 }
207 #endif // NativeImageSkia_h 208 #endif // NativeImageSkia_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/skia/GaneshUtils.cpp ('k') | Source/platform/graphics/skia/NativeImageSkia.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698