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

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: #include NodeRenderStyle.h Created 6 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
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 19 matching lines...) Expand all
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 bool needsClipTracking() const { return false; } 70 virtual bool needsClipTracking() const { return false; }
70 virtual Platform3DObject getBackingTexture() const { return 0; } 71 virtual Platform3DObject getBackingTexture() const { return 0; }
71 virtual void didModifyBackingTexture() { } 72 virtual void didModifyBackingTexture() { }
72 virtual bool cachedBitmapEnabled() const { return false; } 73 virtual bool cachedBitmapEnabled() const { return false; }
73 virtual const SkBitmap& cachedBitmap() const; 74 virtual const SkBitmap& cachedBitmap() const;
74 virtual void invalidateCachedBitmap() { } 75 virtual void invalidateCachedBitmap() { }
75 virtual void updateCachedBitmapIfNeeded() { } 76 virtual void updateCachedBitmapIfNeeded() { }
77 virtual void setFilterLevel(SkPaint::FilterLevel) { }
76 virtual void setIsHidden(bool) { } 78 virtual void setIsHidden(bool) { }
77 virtual void setImageBuffer(ImageBuffer*) { } 79 virtual void setImageBuffer(ImageBuffer*) { }
78 virtual PassRefPtr<SkPicture> getPicture(); 80 virtual PassRefPtr<SkPicture> getPicture();
79 virtual void didClearCanvas() { } 81 virtual void didClearCanvas() { }
80 virtual void finalizeFrame(const FloatRect &dirtyRect) { } 82 virtual void finalizeFrame(const FloatRect &dirtyRect) { }
81 virtual void willDrawVideo() { } 83 virtual void willDrawVideo() { }
82 virtual PassRefPtr<SkImage> newImageSnapshot() const; 84 virtual PassRefPtr<SkImage> newImageSnapshot() const;
83 85
84 OpacityMode opacityMode() const { return m_opacityMode; } 86 OpacityMode opacityMode() const { return m_opacityMode; }
85 const IntSize& size() const { return m_size; } 87 const IntSize& size() const { return m_size; }
86 void notifyIsValidChanged(bool isValid) const; 88 void notifyIsValidChanged(bool isValid) const;
87 89
88 protected: 90 protected:
89 ImageBufferSurface(const IntSize&, OpacityMode); 91 ImageBufferSurface(const IntSize&, OpacityMode);
90 void clear(); 92 void clear();
91 93
92 private: 94 private:
93 OpacityMode m_opacityMode; 95 OpacityMode m_opacityMode;
94 IntSize m_size; 96 IntSize m_size;
95 }; 97 };
96 98
97 } // namespace blink 99 } // namespace blink
98 100
99 #endif 101 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698