diff options
author | victorhsieh@chromium.org <victorhsieh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-27 20:54:03 +0000 |
---|---|---|
committer | victorhsieh@chromium.org <victorhsieh@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-09-27 20:54:03 +0000 |
commit | 29652cf5d1121cdc8833106c98f3808a7620fdee (patch) | |
tree | 068a51c1e73f4ac3b4ceff0a5049712576f9f4d8 /ppapi/tests/test_graphics_2d.h | |
parent | 4e62b3d0ac881be70f5dca51ffc249522d0db7ab (diff) | |
download | chromium_src-29652cf5d1121cdc8833106c98f3808a7620fdee.zip chromium_src-29652cf5d1121cdc8833106c98f3808a7620fdee.tar.gz chromium_src-29652cf5d1121cdc8833106c98f3808a7620fdee.tar.bz2 |
Fix cpu draining callback in Graphics2D::Flush.
Graphics2D::Flush should delay callback when the update is invisible,
while the plugin is visible on current tab.
Contributed by victorhsieh@chromium.org
BUG=
Review URL: https://chromiumcodereview.appspot.com/10933107
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159112 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/tests/test_graphics_2d.h')
-rw-r--r-- | ppapi/tests/test_graphics_2d.h | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/ppapi/tests/test_graphics_2d.h b/ppapi/tests/test_graphics_2d.h index 3c1fe32..193aa44 100644 --- a/ppapi/tests/test_graphics_2d.h +++ b/ppapi/tests/test_graphics_2d.h @@ -21,9 +21,10 @@ class Rect; class TestGraphics2D : public TestCase { public: - explicit TestGraphics2D(TestingInstance* instance) : TestCase(instance) {} + explicit TestGraphics2D(TestingInstance* instance); // TestCase implementation. + virtual void DidChangeView(const pp::View& view); virtual bool Init(); virtual void RunTests(const std::string& filter); @@ -78,6 +79,14 @@ class TestGraphics2D : public TestCase { PP_Resource ReplaceContentsAndReturnID(pp::Graphics2D* dc, const pp::Size& size); + // Resets the internal state of view change. + void ResetViewChangedState(); + + // Waits until we get a view change event. Note that it's possible to receive + // an unexpected event, thus post_quit_on_view_changed_ is introduced so that + // DidChangeView can check whether the event is from here. + bool WaitUntilViewChanged(); + std::string TestInvalidResource(); std::string TestInvalidSize(); std::string TestHumongous(); @@ -87,12 +96,22 @@ class TestGraphics2D : public TestCase { std::string TestScroll(); std::string TestReplace(); std::string TestFlush(); + std::string TestFlushOffscreenUpdate(); std::string TestDev(); std::string TestReplaceContentsCaching(); // Used by the tests that access the C API directly. const PPB_Graphics2D* graphics_2d_interface_; const PPB_ImageData* image_data_interface_; + + // Used to indicate that DidChangeView has happened, in order to make plugin + // and ui synchronous. + bool is_view_changed_; + + // Set to true to request that the next invocation of DidChangeView should + // post a quit to the message loop. DidChangeView will also reset the flag so + // this will only happen once. + bool post_quit_on_view_changed_; }; #endif // PPAPI_TESTS_TEST_GRAPHICS_2D_H_ |