summaryrefslogtreecommitdiffstats
path: root/ppapi/examples/2d
diff options
context:
space:
mode:
authorbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-24 18:04:58 +0000
committerbrettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2011-06-24 18:04:58 +0000
commit8ccd594df1c045bc26def7ba623e262bd0d43218 (patch)
treea5a67c8cf3e2db0476de138537f832f6b7bc640c /ppapi/examples/2d
parentec13ca612aa5f6fed4b33b17802d8141c182b5e9 (diff)
downloadchromium_src-8ccd594df1c045bc26def7ba623e262bd0d43218.zip
chromium_src-8ccd594df1c045bc26def7ba623e262bd0d43218.tar.gz
chromium_src-8ccd594df1c045bc26def7ba623e262bd0d43218.tar.bz2
Don't copy the Graphics2D when binding a new one. This brings the
implementation in line with the interface documentation (the old behavior would clobber any content). The copying behavior was introduced to avoid flickering when resizing. To avoid this, the PaintManager now doesn't bind the new device until it's been painted to. This gives flicker-free painting. This fixes a bug in the paint manager example that made it not paint. TEST=manual BUG=86568 Review URL: http://codereview.chromium.org/7215030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@90386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/examples/2d')
-rw-r--r--ppapi/examples/2d/paint_manager_example.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/ppapi/examples/2d/paint_manager_example.cc b/ppapi/examples/2d/paint_manager_example.cc
index e9b034e..8a5a2f5 100644
--- a/ppapi/examples/2d/paint_manager_example.cc
+++ b/ppapi/examples/2d/paint_manager_example.cc
@@ -73,7 +73,7 @@ class MyInstance : public pp::Instance, public pp::PaintManager::Client {
}
// PaintManager::Client implementation.
- virtual bool OnPaint(pp::Graphics2D&,
+ virtual bool OnPaint(pp::Graphics2D& graphics_2d,
const std::vector<pp::Rect>& paint_rects,
const pp::Rect& paint_bounds) {
// Make an image just large enough to hold all dirty rects. We won't
@@ -114,6 +114,7 @@ class MyInstance : public pp::Instance, public pp::PaintManager::Client {
square.height(),
0xFF000000);
+ graphics_2d.PaintImageData(updated_image, paint_bounds.point());
return true;
}