summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-14 17:10:12 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-11-14 17:10:12 +0000
commit9d01d29527d45e170626f03a998c3ea86264b670 (patch)
tree74089f1efb89a25ff5463e7bf9d8bc698717473d /ppapi
parentfb35dcfafd929772b185516173a92c619aa97421 (diff)
downloadchromium_src-9d01d29527d45e170626f03a998c3ea86264b670.zip
chromium_src-9d01d29527d45e170626f03a998c3ea86264b670.tar.gz
chromium_src-9d01d29527d45e170626f03a998c3ea86264b670.tar.bz2
Fix some bugs in paint manager. Some of the class members were not getting
initialized in the constructor. Also, when a manual callback was executed, if a regular fluch happened to come in the intervening time, we would cause an assertion failure because it would always try to paint. Now when we get the callback, we can ignore it if there is already a flush pending. Original review=http://codereview.chromium.org/4886004/ git-svn-id: svn://svn.chromium.org/chrome/trunk/src@66082 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/cpp/paint_manager.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/ppapi/cpp/paint_manager.cc b/ppapi/cpp/paint_manager.cc
index 87c0750..a20cd0c 100644
--- a/ppapi/cpp/paint_manager.cc
+++ b/ppapi/cpp/paint_manager.cc
@@ -15,7 +15,9 @@ PaintManager::PaintManager()
: instance_(NULL),
client_(NULL),
is_always_opaque_(false),
- callback_factory_(NULL) {
+ callback_factory_(NULL),
+ manual_callback_pending_(false),
+ flush_pending_(false) {
// Set the callback object outside of the initializer list to avoid a
// compiler warning about using "this" in an initializer list.
callback_factory_.Initialize(this);
@@ -27,7 +29,9 @@ PaintManager::PaintManager(Instance* instance,
: instance_(instance),
client_(client),
is_always_opaque_(is_always_opaque),
- callback_factory_(NULL) {
+ callback_factory_(NULL),
+ manual_callback_pending_(false),
+ flush_pending_(false) {
// Set the callback object outside of the initializer list to avoid a
// compiler warning about using "this" in an initializer list.
callback_factory_.Initialize(this);
@@ -167,7 +171,7 @@ void PaintManager::OnManualCallbackComplete(int32_t) {
// invalid regions. Even though we only schedule this callback when something
// is pending, a Flush callback could have come in before this callback was
// executed and that could have cleared the queue.
- if (aggregator_.HasPendingUpdate())
+ if (aggregator_.HasPendingUpdate() && !flush_pending_)
DoPaint();
}