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

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

Issue 2708403003: Implement canvas color space IDL format for 2D canvas (Closed)
Patch Set: Addressing GPU pixel test failures 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 side-by-side diff with in-line comments
Download patch
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 a7bc7ddc4e97f4540a43c2514e2bf9ab22cd826b..6186c7fb4f96970c7bfb35630ae4827bcae6c621 100644
--- a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
@@ -50,11 +50,17 @@ class WebLayer;
enum CanvasColorSpace {
kLegacyCanvasColorSpace,
kSRGBCanvasColorSpace,
- kLinearRGBCanvasColorSpace,
kRec2020CanvasColorSpace,
kP3CanvasColorSpace,
};
+enum CanvasPixelFormat {
+ kRGBA8CanvasPixelFormat,
+ kRGB10A2CanvasPixelFormat,
+ kRGBA12CanvasPixelFormat,
+ kF16CanvasPixelFormat,
+};
+
class CORE_EXPORT CanvasRenderingContext
: public GarbageCollectedFinalized<CanvasRenderingContext>,
public ScriptWrappable,
@@ -88,6 +94,10 @@ class CORE_EXPORT CanvasRenderingContext
CanvasColorSpace colorSpace() const { return m_colorSpace; };
WTF::String colorSpaceAsString() const;
+ CanvasPixelFormat pixelFormat() const { return m_pixelFormat; };
+ WTF::String pixelFormatAsString() const;
+ bool linearPixelMath() const { return m_linearPixelMath; };
+
// The color space in which the the content should be interpreted by the
// compositor. This is always defined.
gfx::ColorSpace gfxColorSpace() const;
@@ -209,6 +219,8 @@ class CORE_EXPORT CanvasRenderingContext
HashSet<String> m_cleanURLs;
HashSet<String> m_dirtyURLs;
CanvasColorSpace m_colorSpace;
+ CanvasPixelFormat m_pixelFormat;
+ bool m_linearPixelMath = false;
CanvasContextCreationAttributes m_creationAttributes;
bool m_finalizeFrameScheduled = false;
};

Powered by Google App Engine
This is Rietveld 408576698