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

Side by Side Diff: third_party/WebKit/Source/platform/graphics/ImageBufferSurface.h

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 3 years, 12 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) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, 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 16 matching lines...) Expand all
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
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 ImageBufferSurface_h 31 #ifndef ImageBufferSurface_h
32 #define ImageBufferSurface_h 32 #define ImageBufferSurface_h
33 33
34 #include "platform/PlatformExport.h" 34 #include "platform/PlatformExport.h"
35 #include "platform/geometry/IntSize.h" 35 #include "platform/geometry/IntSize.h"
36 #include "platform/graphics/GraphicsTypes.h" 36 #include "platform/graphics/GraphicsTypes.h"
37 #include "skia/ext/cdl_common.h"
37 #include "third_party/khronos/GLES2/gl2.h" 38 #include "third_party/khronos/GLES2/gl2.h"
38 #include "third_party/skia/include/core/SkImageInfo.h" 39 #include "third_party/skia/include/core/SkImageInfo.h"
39 #include "third_party/skia/include/core/SkPaint.h" 40 #include "third_party/skia/include/core/SkPaint.h"
40 #include "third_party/skia/include/core/SkRefCnt.h" 41 #include "third_party/skia/include/core/SkRefCnt.h"
41 #include "wtf/Allocator.h" 42 #include "wtf/Allocator.h"
42 #include "wtf/Noncopyable.h" 43 #include "wtf/Noncopyable.h"
43 44
44 class SkCanvas;
45 class SkColorSpace; 45 class SkColorSpace;
46 class SkImage; 46 class SkImage;
47 struct SkImageInfo; 47 struct SkImageInfo;
48 class SkPicture;
49 48
50 namespace blink { 49 namespace blink {
51 50
52 class ImageBuffer; 51 class ImageBuffer;
53 class WebLayer; 52 class WebLayer;
54 class FloatRect; 53 class FloatRect;
55 class GraphicsContext; 54 class GraphicsContext;
56 55
57 class PLATFORM_EXPORT ImageBufferSurface { 56 class PLATFORM_EXPORT ImageBufferSurface {
58 WTF_MAKE_NONCOPYABLE(ImageBufferSurface); 57 WTF_MAKE_NONCOPYABLE(ImageBufferSurface);
59 USING_FAST_MALLOC(ImageBufferSurface); 58 USING_FAST_MALLOC(ImageBufferSurface);
60 59
61 public: 60 public:
62 virtual ~ImageBufferSurface(); 61 virtual ~ImageBufferSurface();
63 62
64 virtual SkCanvas* canvas() = 0; 63 virtual CdlCanvas* canvas() = 0;
65 virtual void disableDeferral(DisableDeferralReason) {} 64 virtual void disableDeferral(DisableDeferralReason) {}
66 virtual void willOverwriteCanvas() {} 65 virtual void willOverwriteCanvas() {}
67 virtual void didDraw(const FloatRect& rect) {} 66 virtual void didDraw(const FloatRect& rect) {}
68 virtual bool isValid() const = 0; 67 virtual bool isValid() const = 0;
69 virtual bool restore() { return false; } 68 virtual bool restore() { return false; }
70 virtual WebLayer* layer() const { return 0; } 69 virtual WebLayer* layer() const { return 0; }
71 virtual bool isAccelerated() const { return false; } 70 virtual bool isAccelerated() const { return false; }
72 virtual bool isRecording() const { return false; } 71 virtual bool isRecording() const { return false; }
73 virtual bool isExpensiveToPaint() { return false; } 72 virtual bool isExpensiveToPaint() { return false; }
74 virtual void setFilterQuality(SkFilterQuality) {} 73 virtual void setFilterQuality(SkFilterQuality) {}
75 virtual void setIsHidden(bool) {} 74 virtual void setIsHidden(bool) {}
76 virtual void setImageBuffer(ImageBuffer*) {} 75 virtual void setImageBuffer(ImageBuffer*) {}
77 virtual sk_sp<SkPicture> getPicture(); 76 virtual sk_sp<CdlPicture> getPicture();
78 virtual void finalizeFrame(const FloatRect& dirtyRect) {} 77 virtual void finalizeFrame(const FloatRect& dirtyRect) {}
79 virtual void draw(GraphicsContext&, 78 virtual void draw(GraphicsContext&,
80 const FloatRect& destRect, 79 const FloatRect& destRect,
81 const FloatRect& srcRect, 80 const FloatRect& srcRect,
82 SkBlendMode); 81 SkBlendMode);
83 virtual void setHasExpensiveOp() {} 82 virtual void setHasExpensiveOp() {}
84 virtual GLuint getBackingTextureHandleForOverwrite() { return 0; } 83 virtual GLuint getBackingTextureHandleForOverwrite() { return 0; }
85 84
86 // Executes all deferred rendering immediately. 85 // Executes all deferred rendering immediately.
87 virtual void flush(FlushReason); 86 virtual void flush(FlushReason);
(...skipping 29 matching lines...) Expand all
117 private: 116 private:
118 OpacityMode m_opacityMode; 117 OpacityMode m_opacityMode;
119 IntSize m_size; 118 IntSize m_size;
120 sk_sp<SkColorSpace> m_colorSpace; 119 sk_sp<SkColorSpace> m_colorSpace;
121 SkColorType m_colorType; 120 SkColorType m_colorType;
122 }; 121 };
123 122
124 } // namespace blink 123 } // namespace blink
125 124
126 #endif 125 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698