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 44aef4d9577b5f41f02d2111beed28b4d9fc4068..521fafa8a960029542d160834abbbf9192a0ffdd 100644 |
--- a/ppapi/tests/power_saver_test_plugin.cc |
+++ b/ppapi/tests/power_saver_test_plugin.cc |
@@ -15,11 +15,14 @@ |
#undef PostMessage |
#endif |
+static void DummyCompletionCallback(void*, int32_t) { |
+} |
+ |
// This is a simple C++ Pepper plugin that enables Plugin Power Saver tests. |
class PowerSaverTestInstance : public pp::Instance { |
public: |
explicit PowerSaverTestInstance(PP_Instance instance) |
- : pp::Instance(instance), callback_factory_(this) {} |
+ : pp::Instance(instance) {} |
~PowerSaverTestInstance() override {} |
bool Init(uint32_t argc, const char* argn[], const char* argv[]) { |
@@ -42,11 +45,11 @@ class PowerSaverTestInstance : public pp::Instance { |
if (!BindGraphics(device_context_)) |
return; |
+ // Since we draw a static image, we only need to make a new frame when |
+ // the device is initialized or the view size changes. |
Paint(); |
} |
- void OnFlush(int32_t) { Paint(); } |
- |
private: |
void Paint() { |
pp::ImageData image(this, PP_IMAGEDATAFORMAT_BGRA_PREMUL, |
@@ -64,13 +67,11 @@ class PowerSaverTestInstance : public pp::Instance { |
device_context_.ReplaceContents(&image); |
device_context_.Flush( |
- callback_factory_.NewCallback(&PowerSaverTestInstance::OnFlush)); |
+ pp::CompletionCallback(&DummyCompletionCallback, nullptr)); |
} |
pp::View view_; |
pp::Graphics2D device_context_; |
- |
- pp::CompletionCallbackFactory<PowerSaverTestInstance> callback_factory_; |
}; |
class PowerSaverTestModule : public pp::Module { |