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

Side by Side Diff: third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h

Issue 2660393002: Use gfx::ColorSpace instead of SkColorSpace in Blink (Closed)
Patch Set: Created 3 years, 10 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) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
81 ContextTypeCount, 81 ContextTypeCount,
82 }; 82 };
83 83
84 static ContextType contextTypeFromId(const String& id); 84 static ContextType contextTypeFromId(const String& id);
85 static ContextType resolveContextTypeAliases(ContextType); 85 static ContextType resolveContextTypeAliases(ContextType);
86 86
87 HTMLCanvasElement* canvas() const { return m_canvas; } 87 HTMLCanvasElement* canvas() const { return m_canvas; }
88 88
89 CanvasColorSpace colorSpace() const { return m_colorSpace; }; 89 CanvasColorSpace colorSpace() const { return m_colorSpace; };
90 WTF::String colorSpaceAsString() const; 90 WTF::String colorSpaceAsString() const;
91 sk_sp<SkColorSpace> skColorSpace() const; 91 // The color space in which the the content should be interpreted by the
92 // compositor. This is always defined.
93 const gfx::ColorSpace& gfxColorSpace() const { return m_gfxColorSpace; }
94 // The color space that should be used for SkSurface creation. This may
95 // be nullptr.
96 sk_sp<SkColorSpace> skSurfaceColorSpace() const;
92 SkColorType colorType() const; 97 SkColorType colorType() const;
93 ColorBehavior colorBehaviorForMediaDrawnToCanvas() const; 98 ColorBehavior colorBehaviorForMediaDrawnToCanvas() const;
94 99
95 virtual PassRefPtr<Image> getImage(AccelerationHint, 100 virtual PassRefPtr<Image> getImage(AccelerationHint,
96 SnapshotReason) const = 0; 101 SnapshotReason) const = 0;
97 virtual ImageData* toImageData(SnapshotReason reason) { return nullptr; } 102 virtual ImageData* toImageData(SnapshotReason reason) { return nullptr; }
98 virtual ContextType getContextType() const = 0; 103 virtual ContextType getContextType() const = 0;
99 virtual bool isAccelerated() const { return false; } 104 virtual bool isAccelerated() const { return false; }
100 virtual bool shouldAntialias() const { return false; } 105 virtual bool shouldAntialias() const { return false; }
101 virtual void setIsHidden(bool) = 0; 106 virtual void setIsHidden(bool) = 0;
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 virtual void stop() = 0; 192 virtual void stop() = 0;
188 193
189 private: 194 private:
190 void dispose(); 195 void dispose();
191 196
192 Member<HTMLCanvasElement> m_canvas; 197 Member<HTMLCanvasElement> m_canvas;
193 Member<OffscreenCanvas> m_offscreenCanvas; 198 Member<OffscreenCanvas> m_offscreenCanvas;
194 HashSet<String> m_cleanURLs; 199 HashSet<String> m_cleanURLs;
195 HashSet<String> m_dirtyURLs; 200 HashSet<String> m_dirtyURLs;
196 CanvasColorSpace m_colorSpace; 201 CanvasColorSpace m_colorSpace;
202 gfx::ColorSpace m_gfxColorSpace;
197 CanvasContextCreationAttributes m_creationAttributes; 203 CanvasContextCreationAttributes m_creationAttributes;
198 }; 204 };
199 205
200 } // namespace blink 206 } // namespace blink
201 207
202 #endif 208 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698