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

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: fix behavior on slow cros bots 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
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..90727f8000ddd84388ac0097085002b7ba4bf6ce 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.
+ int square_size = 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;
Lei Zhang 2015/10/21 07:24:53 that's a funny shade of black
tommycli 2015/10/21 18:16:04 Yeah... haha the comment was wrong.
+ int x_square = x / square_size;
+ int y_square = y / square_size;
+ uint32_t color = ((x_square + y_square) % 2) ? 0xFF0000FF : 0xFF00FF00;
*image.GetAddr32(pp::Point(x, y)) = color;
}
}

Powered by Google App Engine
This is Rietveld 408576698