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

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

Issue 562583002: Implement image-rendering:pixelated for accelerated 2D canvases. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Remove printfs, update test comments. Created 6 years, 1 month 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/GraphicsTypes3D.h" 36 #include "platform/graphics/GraphicsTypes3D.h"
37 #include "third_party/skia/include/core/SkPaint.h"
37 #include "wtf/FastAllocBase.h" 38 #include "wtf/FastAllocBase.h"
38 #include "wtf/Noncopyable.h" 39 #include "wtf/Noncopyable.h"
39 #include "wtf/PassRefPtr.h" 40 #include "wtf/PassRefPtr.h"
40 41
41 class SkBitmap; 42 class SkBitmap;
42 class SkCanvas; 43 class SkCanvas;
43 class SkImage; 44 class SkImage;
44 class SkPicture; 45 class SkPicture;
45 46
46 namespace blink { 47 namespace blink {
(...skipping 18 matching lines...) Expand all
65 virtual bool isValid() const = 0; 66 virtual bool isValid() const = 0;
66 virtual bool restore() { return false; }; 67 virtual bool restore() { return false; };
67 virtual WebLayer* layer() const { return 0; }; 68 virtual WebLayer* layer() const { return 0; };
68 virtual bool isAccelerated() const { return false; } 69 virtual bool isAccelerated() const { return false; }
69 virtual Platform3DObject getBackingTexture() const { return 0; } 70 virtual Platform3DObject getBackingTexture() const { return 0; }
70 virtual void didModifyBackingTexture() { } 71 virtual void didModifyBackingTexture() { }
71 virtual bool cachedBitmapEnabled() const { return false; } 72 virtual bool cachedBitmapEnabled() const { return false; }
72 virtual const SkBitmap& cachedBitmap() const; 73 virtual const SkBitmap& cachedBitmap() const;
73 virtual void invalidateCachedBitmap() { } 74 virtual void invalidateCachedBitmap() { }
74 virtual void updateCachedBitmapIfNeeded() { } 75 virtual void updateCachedBitmapIfNeeded() { }
76 virtual void setFilterLevel(SkPaint::FilterLevel) { }
75 virtual void setIsHidden(bool) { } 77 virtual void setIsHidden(bool) { }
76 virtual void setImageBuffer(ImageBuffer*) { } 78 virtual void setImageBuffer(ImageBuffer*) { }
77 virtual PassRefPtr<SkPicture> getPicture(); 79 virtual PassRefPtr<SkPicture> getPicture();
78 virtual void didClearCanvas() { } 80 virtual void didClearCanvas() { }
79 virtual void finalizeFrame(const FloatRect &dirtyRect) { } 81 virtual void finalizeFrame(const FloatRect &dirtyRect) { }
80 82
81 virtual PassRefPtr<SkImage> newImageSnapshot() const; 83 virtual PassRefPtr<SkImage> newImageSnapshot() const;
82 84
83 OpacityMode opacityMode() const { return m_opacityMode; } 85 OpacityMode opacityMode() const { return m_opacityMode; }
84 const IntSize& size() const { return m_size; } 86 const IntSize& size() const { return m_size; }
85 void notifyIsValidChanged(bool isValid) const; 87 void notifyIsValidChanged(bool isValid) const;
86 88
87 protected: 89 protected:
88 ImageBufferSurface(const IntSize&, OpacityMode); 90 ImageBufferSurface(const IntSize&, OpacityMode);
89 void clear(); 91 void clear();
90 92
91 private: 93 private:
92 OpacityMode m_opacityMode; 94 OpacityMode m_opacityMode;
93 IntSize m_size; 95 IntSize m_size;
94 }; 96 };
95 97
96 } // namespace blink 98 } // namespace blink
97 99
98 #endif 100 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698