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

Unified Diff: ppapi/tests/power_saver_test_plugin.cc

Issue 1412963003: Plugin Power Saver: Implement pixel tests for plugin placeholders. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
« no previous file with comments | « components/plugins/renderer/loadable_plugin_placeholder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/tests/power_saver_test_plugin.cc
diff --git a/ppapi/tests/power_saver_test_plugin.cc b/ppapi/tests/power_saver_test_plugin.cc
index 521fafa8a960029542d160834abbbf9192a0ffdd..a3d85d9a59f4b5f34b46221e4b4e8886bd0d0f5d 100644
--- a/ppapi/tests/power_saver_test_plugin.cc
+++ b/ppapi/tests/power_saver_test_plugin.cc
@@ -57,10 +57,13 @@ class PowerSaverTestInstance : public pp::Instance {
if (image.is_null())
return;
- // Draw black and white stripes to present an "interesting" keyframe.
+ // Draw blue and green checkerboard pattern to show "interesting" keyframe.
+ const int kSquareSizePixels = 8;
for (int y = 0; y < view_.GetRect().size().height(); ++y) {
for (int x = 0; x < view_.GetRect().size().width(); ++x) {
- uint32_t color = x % 2 ? 0xFF0000FF : 0xFFFFFFFF;
+ int x_square = x / kSquareSizePixels;
+ int y_square = y / kSquareSizePixels;
+ uint32_t color = ((x_square + y_square) % 2) ? 0xFF0000FF : 0xFF00FF00;
*image.GetAddr32(pp::Point(x, y)) = color;
}
}
« no previous file with comments | « components/plugins/renderer/loadable_plugin_placeholder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698