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

Unified Diff: Source/platform/graphics/Canvas2DLayerBridge.cpp

Issue 562583002: Implement image-rendering:pixelated for accelerated 2D canvases. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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: Source/platform/graphics/Canvas2DLayerBridge.cpp
diff --git a/Source/platform/graphics/Canvas2DLayerBridge.cpp b/Source/platform/graphics/Canvas2DLayerBridge.cpp
index bc23de81f21ec395ebd8295764b3516e413bbbe1..0d069148d9883cced45501c0bbd0343ddf7e1cee 100644
--- a/Source/platform/graphics/Canvas2DLayerBridge.cpp
+++ b/Source/platform/graphics/Canvas2DLayerBridge.cpp
@@ -86,6 +86,7 @@ Canvas2DLayerBridge::Canvas2DLayerBridge(PassOwnPtr<WebGraphicsContext3DProvider
, m_framesSinceMailboxRelease(0)
, m_destructionInProgress(false)
, m_rateLimitingEnabled(false)
+ , m_nearestNeighbor(false)
, m_isHidden(false)
, m_next(0)
, m_prev(0)
@@ -102,6 +103,7 @@ Canvas2DLayerBridge::Canvas2DLayerBridge(PassOwnPtr<WebGraphicsContext3DProvider
m_layer->setBlendBackgroundColor(opacityMode != Opaque);
GraphicsLayer::registerContentsLayer(m_layer->layer());
m_layer->setRateLimitContext(m_rateLimitingEnabled);
+ m_layer->setNearestNeighbor(m_nearestNeighbor);
m_canvas->setNotificationClient(this);
#ifndef NDEBUG
canvas2DLayerBridgeInstanceCounter.increment();
@@ -150,6 +152,15 @@ void Canvas2DLayerBridge::beginDestruction()
ASSERT(!m_bytesAllocated);
}
+void Canvas2DLayerBridge::setNearestNeighbor(bool nearestNeighbor)
+{
+ ASSERT(!m_destructionInProgress);
+ if (m_nearestNeighbor != nearestNeighbor) {
+ m_nearestNeighbor = nearestNeighbor;
+ m_layer->setNearestNeighbor(m_nearestNeighbor);
+ }
+}
+
void Canvas2DLayerBridge::setIsHidden(bool hidden)
{
ASSERT(!m_destructionInProgress);

Powered by Google App Engine
This is Rietveld 408576698