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

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

Issue 2552893005: Add ColorBehavior to GraphicsLayer and GraphicsContext (Closed)
Patch Set: Rebase 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/GraphicsLayer.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/GraphicsLayer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
index 55b20d38141879bd740a87dce407fd13bb8bbb8b..bd249cfd0d063abdb1d0b67793e72e4b2190f773 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -110,12 +110,18 @@ GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client)
m_contentsLayerId(0),
m_scrollableArea(nullptr),
m_renderingContext3d(0),
+ m_colorBehavior(ColorBehavior::transformToGlobalTarget()),
m_hasPreferredRasterBounds(false) {
#if ENABLE(ASSERT)
if (m_client)
m_client->verifyNotPainting();
#endif
+ // In true color mode, no inputs are adjusted, and all colors are converted
+ // at rasterization time.
+ if (RuntimeEnabledFeatures::trueColorRenderingEnabled())
+ m_colorBehavior = ColorBehavior::tag();
+
m_contentLayerDelegate = WTF::makeUnique<ContentLayerDelegate>(this);
m_layer = Platform::current()->compositorSupport()->createContentLayer(
m_contentLayerDelegate.get());
@@ -327,7 +333,8 @@ bool GraphicsLayer::paintWithoutCommit(
return false;
}
- GraphicsContext context(getPaintController(), disabledMode);
+ GraphicsContext context(getPaintController(), disabledMode, nullptr,
+ m_colorBehavior);
m_previousInterestRect = *interestRect;
m_client->paintContents(this, context, m_paintingPhase, *interestRect);
@@ -1234,7 +1241,9 @@ sk_sp<SkPicture> GraphicsLayer::capturePicture() {
return nullptr;
IntSize intSize = expandedIntSize(size());
- GraphicsContext graphicsContext(getPaintController());
+ GraphicsContext graphicsContext(getPaintController(),
+ GraphicsContext::NothingDisabled, nullptr,
+ m_colorBehavior);
graphicsContext.beginRecording(IntRect(IntPoint(0, 0), intSize));
getPaintController().paintArtifact().replay(graphicsContext);
return graphicsContext.endRecording();
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/GraphicsLayer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698