Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h |
| diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h |
| index aaf33831899d843bca629adb615a885a1ec6f7f2..f0c5dca123beab202c39d9b37defd61d15179ab2 100644 |
| --- a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h |
| +++ b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h |
| @@ -28,21 +28,28 @@ |
| #include "core/CoreExport.h" |
| #include "core/html/HTMLCanvasElement.h" |
| +#include "core/html/canvas/CanvasContextCreationAttributes.h" |
| #include "core/offscreencanvas/OffscreenCanvas.h" |
| +#include "third_party/skia/include/core/SkColorSpace.h" |
| #include "wtf/HashSet.h" |
| #include "wtf/Noncopyable.h" |
| #include "wtf/text/StringHash.h" |
| class SkCanvas; |
| -namespace blink { class WebLayer; } |
| - |
| namespace blink { |
| class CanvasImageSource; |
| class HTMLCanvasElement; |
| class ImageData; |
| class ImageBitmap; |
| +class WebLayer; |
| + |
| +enum CanvasColorSpace { |
| + kLegacyCanvasColorSpace, |
| + kSRGBCanvasColorSpace, |
| + kLinearRGBCanvasColorSpace, |
| +}; |
| class CORE_EXPORT CanvasRenderingContext : public GarbageCollectedFinalized<CanvasRenderingContext>, public ScriptWrappable { |
| WTF_MAKE_NONCOPYABLE(CanvasRenderingContext); |
| @@ -69,10 +76,14 @@ public: |
| HTMLCanvasElement* canvas() const { return m_canvas; } |
| + CanvasColorSpace colorSpace() const { return m_colorSpace; }; |
| + WTF::String colorSpaceAsString() const; |
| + sk_sp<SkColorSpace> skColorSpace() const; |
| + |
| + virtual bool hasAlpha() const { return creationAttributes().alpha(); } |
|
Stephen White
2016/08/12 19:48:31
As discussed, let's see if we can get rid of this
Justin Novosad
2016/08/12 20:08:49
Done.
|
| virtual ContextType getContextType() const = 0; |
| virtual bool isAccelerated() const { return false; } |
| virtual bool shouldAntialias() const { return false; } |
| - virtual bool hasAlpha() const { return true; } |
| virtual void setIsHidden(bool) = 0; |
| virtual bool isContextLost() const { return true; } |
| virtual void setCanvasGetContextResult(RenderingContext&) { NOTREACHED(); }; |
| @@ -133,8 +144,10 @@ public: |
| void detachCanvas() { m_canvas = nullptr; } |
| + const CanvasContextCreationAttributes& creationAttributes() const { return m_creationAttributes; } |
| + |
| protected: |
| - CanvasRenderingContext(HTMLCanvasElement* = nullptr, OffscreenCanvas* = nullptr); |
| + CanvasRenderingContext(HTMLCanvasElement*, OffscreenCanvas*, const CanvasContextCreationAttributes&); |
| DECLARE_VIRTUAL_TRACE(); |
| virtual void stop() = 0; |
| @@ -145,6 +158,8 @@ private: |
| Member<OffscreenCanvas> m_offscreenCanvas; |
| HashSet<String> m_cleanURLs; |
| HashSet<String> m_dirtyURLs; |
| + CanvasColorSpace m_colorSpace; |
| + CanvasContextCreationAttributes m_creationAttributes; |
| }; |
| } // namespace blink |