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

Unified Diff: third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.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/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp b/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
index e15d266bc2f3b2ab4e6a4801acc6d5bcea8372cc..fd5a436f177c544cc95700fcde04fc30b298ce5d 100644
--- a/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
+++ b/third_party/WebKit/Source/platform/graphics/gpu/AcceleratedImageBufferSurface.cpp
@@ -42,9 +42,8 @@ namespace blink {
AcceleratedImageBufferSurface::AcceleratedImageBufferSurface(
const IntSize& size,
OpacityMode opacity_mode,
- sk_sp<SkColorSpace> color_space,
- SkColorType color_type)
- : ImageBufferSurface(size, opacity_mode, color_space, color_type) {
+ const CanvasColorParams& color_params)
+ : ImageBufferSurface(size, opacity_mode, color_params) {
if (!SharedGpuContext::IsValid())
return;
GrContext* gr_context = SharedGpuContext::Gr();
@@ -53,8 +52,9 @@ AcceleratedImageBufferSurface::AcceleratedImageBufferSurface(
SkAlphaType alpha_type =
(kOpaque == opacity_mode) ? kOpaque_SkAlphaType : kPremul_SkAlphaType;
- SkImageInfo info = SkImageInfo::Make(size.Width(), size.Height(), color_type,
- alpha_type, color_space);
+ SkImageInfo info = SkImageInfo::Make(
+ size.Width(), size.Height(), color_params.GetSkColorType(), alpha_type,
+ color_params.GetSkColorSpaceForSkSurfaces());
SkSurfaceProps disable_lcd_props(0, kUnknown_SkPixelGeometry);
surface_ = SkSurface::MakeRenderTarget(
gr_context, SkBudgeted::kYes, info, 0 /* sampleCount */,

Powered by Google App Engine
This is Rietveld 408576698