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

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

Issue 2823063002: Consolidate canvas color params into a single class (Closed)
Patch Set: Fix compile Created 3 years, 8 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e6469998b0202746a9ed5907dba8fca5db4ba8ee..0a6a23691497677ed02aab1ccb14c988d7ec3576 100644
--- a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.h
@@ -31,6 +31,7 @@
#include "core/html/canvas/CanvasContextCreationAttributes.h"
#include "core/layout/HitTestCanvasResult.h"
#include "core/offscreencanvas/OffscreenCanvas.h"
+#include "platform/graphics/CanvasColorParams.h"
#include "platform/graphics/ColorBehavior.h"
#include "platform/wtf/HashSet.h"
#include "platform/wtf/Noncopyable.h"
@@ -47,20 +48,6 @@ class ImageData;
class ImageBitmap;
class WebLayer;
-enum CanvasColorSpace {
- kLegacyCanvasColorSpace,
- kSRGBCanvasColorSpace,
- kRec2020CanvasColorSpace,
- kP3CanvasColorSpace,
-};
-
-enum CanvasPixelFormat {
- kRGBA8CanvasPixelFormat,
- kRGB10A2CanvasPixelFormat,
- kRGBA12CanvasPixelFormat,
- kF16CanvasPixelFormat,
-};
-
constexpr const char* kLegacyCanvasColorSpaceName = "legacy-srgb";
constexpr const char* kSRGBCanvasColorSpaceName = "srgb";
constexpr const char* kRec2020CanvasColorSpaceName = "rec2020";
@@ -102,11 +89,11 @@ class CORE_EXPORT CanvasRenderingContext
HTMLCanvasElement* canvas() const { return canvas_; }
- CanvasColorSpace ColorSpace() const { return color_space_; };
+ CanvasColorSpace ColorSpace() const;
WTF::String ColorSpaceAsString() const;
- CanvasPixelFormat PixelFormat() const { return pixel_format_; };
+ CanvasPixelFormat PixelFormat() const;
WTF::String PixelFormatAsString() const;
- bool LinearPixelMath() const { return linear_pixel_math_; };
+ bool LinearPixelMath() const;
// The color space in which the the content should be interpreted by the
// compositor. This is always defined.
@@ -232,9 +219,7 @@ class CORE_EXPORT CanvasRenderingContext
Member<OffscreenCanvas> offscreen_canvas_;
HashSet<String> clean_urls_;
HashSet<String> dirty_urls_;
- CanvasColorSpace color_space_;
- CanvasPixelFormat pixel_format_;
- bool linear_pixel_math_ = false;
+ CanvasColorParams color_params_;
CanvasContextCreationAttributes creation_attributes_;
bool finalize_frame_scheduled_ = false;
};
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698