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

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

Issue 2410513002: Plumb preferred raster scale for background images from Blink to cc layers. (Closed)
Patch Set: none Created 4 years, 2 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/GraphicsLayer.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
index 2eac66ac70d939243f33ab3055f4a80a22997b9f..7fe49b034efb7cb49ab24f0cac61828e7ef8ba14 100644
--- a/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
+++ b/third_party/WebKit/Source/platform/graphics/GraphicsLayer.cpp
@@ -109,7 +109,9 @@ GraphicsLayer::GraphicsLayer(GraphicsLayerClient* client)
m_contentsLayer(0),
m_contentsLayerId(0),
m_scrollableArea(nullptr),
- m_renderingContext3d(0) {
+ m_renderingContext3d(0),
+ m_preferredRasterScale(1.0f),
+ m_hasPreferredRasterScale(false) {
#if ENABLE(ASSERT)
if (m_client)
m_client->verifyNotPainting();
@@ -149,6 +151,18 @@ void GraphicsLayer::setHasWillChangeTransformHint(bool hasWillChangeTransform) {
m_layer->layer()->setHasWillChangeTransformHint(hasWillChangeTransform);
}
+void GraphicsLayer::setPreferredRasterScale(float preferredRasterScale) {
+ m_preferredRasterScale = preferredRasterScale;
+ m_hasPreferredRasterScale = true;
+ m_layer->layer()->setPreferredRasterScale(preferredRasterScale);
+}
+
+void GraphicsLayer::clearPreferredRasterScale() {
+ m_preferredRasterScale = 1.0f;
+ m_hasPreferredRasterScale = false;
+ m_layer->layer()->clearPreferredRasterScale();
+}
+
void GraphicsLayer::setParent(GraphicsLayer* layer) {
ASSERT(!layer || !layer->hasAncestor(this));
m_parent = layer;
@@ -673,6 +687,9 @@ std::unique_ptr<JSONObject> GraphicsLayer::layerAsJSONInternal(
json->setString("backfaceVisibility",
m_backfaceVisibility ? "visible" : "hidden");
+ if (m_hasPreferredRasterScale)
+ json->setDouble("preferredRasterScale", m_preferredRasterScale);
+
if (flags & LayerTreeIncludesDebugInfo)
json->setString("client", pointerAsString(m_client));
« no previous file with comments | « third_party/WebKit/Source/platform/graphics/GraphicsLayer.h ('k') | third_party/WebKit/public/platform/WebLayer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698