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

Unified Diff: third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp

Issue 2572873002: Add ColorBehavior plumbing for 2D canvas drawImage (Closed)
Patch Set: Created 4 years 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 | « third_party/WebKit/Source/platform/graphics/ColorBehavior.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp b/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
index 10969e12369f813e18fee2c1787079da3769ce82..ade02330ba90ef474a55aff70c172053b39ab39a 100644
--- a/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
+++ b/third_party/WebKit/Source/platform/graphics/ColorBehavior.cpp
@@ -38,6 +38,17 @@ void ColorBehavior::setGlobalTargetColorProfile(
BitmapImageMetrics::countOutputGamma(gTargetColorSpace);
}
+void ColorBehavior::setGlobalTargetColorSpaceForTesting(
+ const sk_sp<SkColorSpace>& colorSpace) {
+ // Take a lock around initializing and accessing the global device color
+ // profile.
+ SpinLock::Guard guard(gTargetColorSpaceLock);
+
+ SkSafeUnref(gTargetColorSpace);
+ gTargetColorSpace = colorSpace.get();
+ SkSafeRef(gTargetColorSpace);
+}
+
// static
sk_sp<SkColorSpace> ColorBehavior::globalTargetColorSpace() {
// Take a lock around initializing and accessing the global device color
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/ColorBehavior.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698