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

Side by Side Diff: third_party/WebKit/Source/modules/canvas2d/CanvasRenderingContext2DTest.cpp

Issue 2595833003: Correct the behavior of createImageBitmap's "default" color space conversion (Closed)
Patch Set: Replacing SRGB with display color profile Created 3 years, 12 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/canvas2d/CanvasRenderingContext2D.h" 5 #include "modules/canvas2d/CanvasRenderingContext2D.h"
6 6
7 #include "core/dom/Document.h" 7 #include "core/dom/Document.h"
8 #include "core/fetch/MemoryCache.h" 8 #include "core/fetch/MemoryCache.h"
9 #include "core/frame/FrameView.h" 9 #include "core/frame/FrameView.h"
10 #include "core/frame/ImageBitmap.h" 10 #include "core/frame/ImageBitmap.h"
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after
1355 SkImage* convertedImage = 1355 SkImage* convertedImage =
1356 imageBitmap->bitmapImage() 1356 imageBitmap->bitmapImage()
1357 ->imageForCurrentFrame(ColorBehavior::ignore()) 1357 ->imageForCurrentFrame(ColorBehavior::ignore())
1358 .get(); 1358 .get();
1359 1359
1360 switch (colorSpaceConversion) { 1360 switch (colorSpaceConversion) {
1361 case ColorSpaceConversion::NONE: 1361 case ColorSpaceConversion::NONE:
1362 NOTREACHED(); 1362 NOTREACHED();
1363 break; 1363 break;
1364 case ColorSpaceConversion::DEFAULT_NOT_COLOR_CORRECTED: 1364 case ColorSpaceConversion::DEFAULT_NOT_COLOR_CORRECTED:
1365 // TODO(zakerinasab): Replace sRGB with a call to 1365 colorSpace = ColorBehavior::globalTargetColorSpace();
1366 // ImageDecoder::globalTargetColorSpace() when the crash problem on Mac
1367 // is fixed. crbug.com/668546.
1368 colorSpace = SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named);
1369 colorFormat = colorFormat32; 1366 colorFormat = colorFormat32;
1370 break; 1367 break;
1371 case ColorSpaceConversion::DEFAULT_COLOR_CORRECTED: 1368 case ColorSpaceConversion::DEFAULT_COLOR_CORRECTED:
1372 case ColorSpaceConversion::SRGB: 1369 case ColorSpaceConversion::SRGB:
1373 colorSpace = SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); 1370 colorSpace = SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named);
1374 colorFormat = colorFormat32; 1371 colorFormat = colorFormat32;
1375 break; 1372 break;
1376 case ColorSpaceConversion::LINEAR_RGB: 1373 case ColorSpaceConversion::LINEAR_RGB:
1377 colorSpace = SkColorSpace::MakeNamed(SkColorSpace::kSRGBLinear_Named); 1374 colorSpace = SkColorSpace::MakeNamed(SkColorSpace::kSRGBLinear_Named);
1378 colorType = SkColorType::kRGBA_F16_SkColorType; 1375 colorType = SkColorType::kRGBA_F16_SkColorType;
(...skipping 27 matching lines...) Expand all
1406 1403
1407 RuntimeEnabledFeatures::setExperimentalCanvasFeaturesEnabled( 1404 RuntimeEnabledFeatures::setExperimentalCanvasFeaturesEnabled(
1408 experimentalCanvasFeaturesRuntimeFlag); 1405 experimentalCanvasFeaturesRuntimeFlag);
1409 RuntimeEnabledFeatures::setColorCorrectRenderingEnabled( 1406 RuntimeEnabledFeatures::setColorCorrectRenderingEnabled(
1410 colorCorrectRenderingRuntimeFlag); 1407 colorCorrectRenderingRuntimeFlag);
1411 RuntimeEnabledFeatures::setColorCorrectRenderingDefaultModeEnabled( 1408 RuntimeEnabledFeatures::setColorCorrectRenderingDefaultModeEnabled(
1412 colorCorrectRenderingDefaultModeRuntimeFlag); 1409 colorCorrectRenderingDefaultModeRuntimeFlag);
1413 } 1410 }
1414 1411
1415 } // namespace blink 1412 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/frame/ImageBitmapTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698