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

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

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/core/html/canvas/CanvasRenderingContext.cpp
diff --git a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp
index 23590934b119cea0659da88e56e1cbc53ac72ede..bb9f51ccd805e9e200cb0c034196ce67ccee830a 100644
--- a/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp
+++ b/third_party/WebKit/Source/core/html/canvas/CanvasRenderingContext.cpp
@@ -67,7 +67,7 @@ CanvasRenderingContext::CanvasRenderingContext(
// linearPixelMath rather than the requested one.
creation_attributes_.setColorSpace(ColorSpaceAsString());
creation_attributes_.setPixelFormat(PixelFormatAsString());
- creation_attributes_.setLinearPixelMath(LinearPixelMath());
+ creation_attributes_.setLinearPixelMath(color_params_.LinearPixelMath());
}
WTF::String CanvasRenderingContext::ColorSpaceAsString() const {
@@ -100,37 +100,13 @@ WTF::String CanvasRenderingContext::PixelFormatAsString() const {
return "";
}
-gfx::ColorSpace CanvasRenderingContext::GfxColorSpace() const {
- return color_params_.GetGfxColorSpace();
-}
-
-sk_sp<SkColorSpace> CanvasRenderingContext::SkSurfaceColorSpace() const {
- return color_params_.GetSkColorSpaceForSkSurfaces();
-}
-
-bool CanvasRenderingContext::SkSurfacesUseColorSpace() const {
- return color_params_.GetSkColorSpaceForSkSurfaces();
-}
-
-bool CanvasRenderingContext::LinearPixelMath() const {
- return color_params_.LinearPixelMath();
-}
-
ColorBehavior CanvasRenderingContext::ColorBehaviorForMediaDrawnToCanvas()
const {
if (RuntimeEnabledFeatures::colorCorrectRenderingEnabled())
- return ColorBehavior::TransformTo(GfxColorSpace());
+ return ColorBehavior::TransformTo(color_params_.GetGfxColorSpace());
return ColorBehavior::TransformToGlobalTarget();
}
-CanvasColorSpace CanvasRenderingContext::ColorSpace() const {
- return color_params_.color_space();
-}
-
-SkColorType CanvasRenderingContext::ColorType() const {
- return color_params_.GetSkColorType();
-}
-
void CanvasRenderingContext::Dispose() {
if (finalize_frame_scheduled_) {
Platform::Current()->CurrentThread()->RemoveTaskObserver(this);

Powered by Google App Engine
This is Rietveld 408576698