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

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

Issue 562583002: Implement image-rendering:pixelated for accelerated 2D canvases. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Don't call setImageInterpolationQuality 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) 2006 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2006 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 4 * Copyright (C) 2010 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 19 matching lines...) Expand all
30 30
31 #include "platform/PlatformExport.h" 31 #include "platform/PlatformExport.h"
32 #include "platform/geometry/FloatRect.h" 32 #include "platform/geometry/FloatRect.h"
33 #include "platform/geometry/IntSize.h" 33 #include "platform/geometry/IntSize.h"
34 #include "platform/graphics/Canvas2DLayerBridge.h" 34 #include "platform/graphics/Canvas2DLayerBridge.h"
35 #include "platform/graphics/ColorSpace.h" 35 #include "platform/graphics/ColorSpace.h"
36 #include "platform/graphics/GraphicsTypes.h" 36 #include "platform/graphics/GraphicsTypes.h"
37 #include "platform/graphics/GraphicsTypes3D.h" 37 #include "platform/graphics/GraphicsTypes3D.h"
38 #include "platform/graphics/ImageBufferSurface.h" 38 #include "platform/graphics/ImageBufferSurface.h"
39 #include "platform/transforms/AffineTransform.h" 39 #include "platform/transforms/AffineTransform.h"
40 #include "third_party/skia/include/core/SkPaint.h"
40 #include "wtf/Forward.h" 41 #include "wtf/Forward.h"
41 #include "wtf/OwnPtr.h" 42 #include "wtf/OwnPtr.h"
42 #include "wtf/PassOwnPtr.h" 43 #include "wtf/PassOwnPtr.h"
43 #include "wtf/PassRefPtr.h" 44 #include "wtf/PassRefPtr.h"
44 45
45 namespace WTF { 46 namespace WTF {
46 47
47 class ArrayBufferContents; 48 class ArrayBufferContents;
48 49
49 } // namespace WTF 50 } // namespace WTF
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ~ImageBuffer(); 83 ~ImageBuffer();
83 84
84 void setClient(ImageBufferClient* client) { m_client = client; } 85 void setClient(ImageBufferClient* client) { m_client = client; }
85 86
86 const IntSize& size() const { return m_surface->size(); } 87 const IntSize& size() const { return m_surface->size(); }
87 bool isAccelerated() const { return m_surface->isAccelerated(); } 88 bool isAccelerated() const { return m_surface->isAccelerated(); }
88 bool isSurfaceValid() const; 89 bool isSurfaceValid() const;
89 bool restoreSurface() const; 90 bool restoreSurface() const;
90 bool needsClipTracking() const { return m_surface->needsClipTracking(); } 91 bool needsClipTracking() const { return m_surface->needsClipTracking(); }
91 92
93 void setFilterLevel(SkPaint::FilterLevel filterLevel) { m_surface->setFilter Level(filterLevel); }
92 void setIsHidden(bool hidden) { m_surface->setIsHidden(hidden); } 94 void setIsHidden(bool hidden) { m_surface->setIsHidden(hidden); }
93 95
94 // Called by subclasses of ImageBufferSurface to install a new canvas object 96 // Called by subclasses of ImageBufferSurface to install a new canvas object
95 void resetCanvas(SkCanvas*); 97 void resetCanvas(SkCanvas*);
96 98
97 void willDrawVideo() { m_surface->willDrawVideo(); } 99 void willDrawVideo() { m_surface->willDrawVideo(); }
98 100
99 GraphicsContext* context() const; 101 GraphicsContext* context() const;
100 102
101 // Called at the end of a task that rendered a whole frame 103 // Called at the end of a task that rendered a whole frame
102 void finalizeFrame(const FloatRect &dirtyRect); 104 void finalizeFrame(const FloatRect &dirtyRect);
103 void didFinalizeFrame(); 105 void didFinalizeFrame();
104 106
105 bool isDirty(); 107 bool isDirty();
106 108
107 const SkBitmap& bitmap() const; 109 const SkBitmap& bitmap() const;
108 110
111 void willAccessPixels() { m_surface->willAccessPixels(); }
112
109 PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavi or = Scaled) const; 113 PassRefPtr<Image> copyImage(BackingStoreCopy = CopyBackingStore, ScaleBehavi or = Scaled) const;
110 // Give hints on the faster copyImage Mode, return DontCopyBackingStore if i t supports the DontCopyBackingStore behavior 114 // Give hints on the faster copyImage Mode, return DontCopyBackingStore if i t supports the DontCopyBackingStore behavior
111 // or return CopyBackingStore if it doesn't. 115 // or return CopyBackingStore if it doesn't.
112 static BackingStoreCopy fastCopyImageMode(); 116 static BackingStoreCopy fastCopyImageMode();
113 117
114 bool getImageData(Multiply, const IntRect&, WTF::ArrayBufferContents&) const ; 118 bool getImageData(Multiply, const IntRect&, WTF::ArrayBufferContents&) const ;
115 119
116 void putByteArray(Multiply, const unsigned char* source, const IntSize& sour ceSize, const IntRect& sourceRect, const IntPoint& destPoint); 120 void putByteArray(Multiply, const unsigned char* source, const IntSize& sour ceSize, const IntRect& sourceRect, const IntPoint& destPoint);
117 121
118 String toDataURL(const String& mimeType, const double* quality = 0) const; 122 String toDataURL(const String& mimeType, const double* quality = 0) const;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 friend class SkiaImageFilterBuilder; 154 friend class SkiaImageFilterBuilder;
151 155
152 OwnPtr<ImageBufferSurface> m_surface; 156 OwnPtr<ImageBufferSurface> m_surface;
153 OwnPtr<GraphicsContext> m_context; 157 OwnPtr<GraphicsContext> m_context;
154 ImageBufferClient* m_client; 158 ImageBufferClient* m_client;
155 }; 159 };
156 160
157 } // namespace blink 161 } // namespace blink
158 162
159 #endif // ImageBuffer_h 163 #endif // ImageBuffer_h
OLDNEW
« no previous file with comments | « Source/platform/graphics/Canvas2DLayerBridge.cpp ('k') | Source/platform/graphics/ImageBufferSurface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698