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

Unified Diff: third_party/WebKit/Source/platform/graphics/CanvasColorParams.h

Issue 2825183002: Plumb CanvasColorParams to canvas image classes (Closed)
Patch Set: Require both runtime flags 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
Index: third_party/WebKit/Source/platform/graphics/CanvasColorParams.h
diff --git a/third_party/WebKit/Source/platform/graphics/CanvasColorParams.h b/third_party/WebKit/Source/platform/graphics/CanvasColorParams.h
index daf034af488f2357efa27308fe6833a770fc0c95..32d2c1b6e96196289df9fa46602c19e552a35235 100644
--- a/third_party/WebKit/Source/platform/graphics/CanvasColorParams.h
+++ b/third_party/WebKit/Source/platform/graphics/CanvasColorParams.h
@@ -31,22 +31,33 @@ enum CanvasPixelFormat {
class PLATFORM_EXPORT CanvasColorParams {
public:
+ // The default constructor will create an output-blended 8-bit surface.
+ CanvasColorParams();
CanvasColorParams(CanvasColorSpace, CanvasPixelFormat);
CanvasColorSpace color_space() const { return color_space_; }
CanvasPixelFormat pixel_format() const { return pixel_format_; }
+ // Returns true if the canvas uses blends output color space values (that is,
+ // not linear space colors).
+ bool UsesOutputSpaceBlending() const;
+
// The SkColorSpace to use in the SkImageInfo for allocated SkSurfaces. This
// is nullptr in legacy rendering mode.
sk_sp<SkColorSpace> GetSkColorSpaceForSkSurfaces() const;
// The pixel format to use for allocating SkSurfaces.
SkColorType GetSkColorType() const;
+ uint8_t BytesPerPixel() const;
- // The color space to use for compositing.
+ // The color space to use for compositing. This will always return a valid
+ // gfx or skia color space.
gfx::ColorSpace GetGfxColorSpace() const;
+ sk_sp<SkColorSpace> GetSkColorSpace() const;
// This matches CanvasRenderingContext::LinearPixelMath, and is true only when
// the pixel format is half-float linear.
+ // TODO(ccameron): This is not the same as !UsesOutputSpaceBlending, but
+ // perhaps should be.
bool LinearPixelMath() const;
private:

Powered by Google App Engine
This is Rietveld 408576698