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

Unified Diff: third_party/WebKit/Source/core/html/ImageDocument.cpp

Issue 2523513002: Simplify ImageDocument checkerboard background styling (Closed)
Patch Set: typos Created 4 years, 1 month 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/LayoutTests/TestExpectations ('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/core/html/ImageDocument.cpp
diff --git a/third_party/WebKit/Source/core/html/ImageDocument.cpp b/third_party/WebKit/Source/core/html/ImageDocument.cpp
index 88826f4d3894c9781ee2ab8eba50a45a760c2b64..536f9ec932086bdb0ba161c1df8d7dc05c7fffd8 100644
--- a/third_party/WebKit/Source/core/html/ImageDocument.cpp
+++ b/third_party/WebKit/Source/core/html/ImageDocument.cpp
@@ -418,12 +418,15 @@ void ImageDocument::updateImageStyle() {
imageStyle.append(AtomicString::number(tileSize));
imageStyle.append("px;");
+ // Generating the checkerboard pattern this way is not exactly cheap.
+ // If rasterization performance becomes an issue, we could look at using
+ // a cheaper shader (e.g. pre-generate a scaled tile + base64-encode +
+ // inline dataURI => single bitmap shader).
imageStyle.append(
- "background-color: white;"
"background-image:"
"linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, "
"#eee 75%, #eee 100%),"
- "linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, "
+ "linear-gradient(45deg, #eee 25%, white 25%, white 75%, "
"#eee 75%, #eee 100%);");
}
}
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698