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

Unified Diff: LayoutTests/css3/images/pixelated-canvas-composited.html

Issue 562583002: Implement image-rendering:pixelated for accelerated 2D canvases. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Change setNearestNeighbor to setFilterLevel, use SkPaint::FilterLevel. 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: LayoutTests/css3/images/pixelated-canvas-composited.html
diff --git a/LayoutTests/css3/images/pixelated-canvas-composited.html b/LayoutTests/css3/images/pixelated-canvas-composited.html
new file mode 100644
index 0000000000000000000000000000000000000000..e6a0f6300e9de8a9d8e3a361c8c005a941804ab8
--- /dev/null
+++ b/LayoutTests/css3/images/pixelated-canvas-composited.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<style>
+ img {
+ display: none;
+ }
+ canvas {
+ width: 1000px;
+ height: 1000px;
+ image-rendering: pixelated;
+ }
+ .under {
+ position: absolute;
+ top: 0;
+ left: 0;
+ z-index: 1;
+ }
+ .over {
+ position: absolute;
+ top: 250px;
+ left: 250px;
+ z-index: 2;
+ }
+</style>
+<body>
+ <img src="resources/dice_alpha.png">
+ <!-- One canvas should be overlaid on the other at an offset. Both canvases should be upscaled without blurring. -->
+ <canvas class="under" width="300" height="300"></canvas>
+ <canvas class="over" width="300" height="300"></canvas>
+</body>
+<script>
+ // Ignore the render tree.
+ if (window.testRunner)
+ window.testRunner.dumpAsTextWithPixelResults();
+
+ var image = document.getElementsByTagName("img")[0];
+
+ function drawToContext(context) {
+ context.drawImage(image, -0.5, -0.5, 300, 300);
+ }
+
+ function draw() {
+ drawToContext(document.getElementsByTagName("canvas")[0].getContext("2d"));
+ drawToContext(document.getElementsByTagName("canvas")[1].getContext("2d"));
+ }
+ window.onload = draw;
+</script>
« no previous file with comments | « no previous file | LayoutTests/css3/images/pixelated-canvas-webgl.html » ('j') | Source/core/html/HTMLCanvasElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698