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

Unified Diff: ppapi/cpp/paint_manager.h

Issue 7215030: Don't copy the Graphics2D when binding a new one. This brings the (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 6 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
« no previous file with comments | « no previous file | ppapi/cpp/paint_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/paint_manager.h
===================================================================
--- ppapi/cpp/paint_manager.h (revision 89742)
+++ ppapi/cpp/paint_manager.h (working copy)
@@ -146,9 +146,12 @@
// position changed).
void SetSize(const Size& new_size);
- // Provides access to the underlying device in case you need it. Note: if
- // you call Flush on this device the paint manager will get very confused,
- // don't do this!
+ // Provides access to the underlying device in case you need it. If you have
+ // done a SetSize, note that the graphics context won't be updated until
+ // right before the next OnPaint call.
+ //
+ // Note: if you call Flush on this device the paint manager will get very
+ // confused, don't do this!
const Graphics2D& graphics() const { return graphics_; }
Graphics2D& graphics() { return graphics_; }
@@ -161,6 +164,12 @@
// The given rect should be scrolled by the given amounts.
void ScrollRect(const Rect& clip_rect, const Point& amount);
+ // Returns the size of the graphics context for the next paint operation.
+ // This is the pending size if a resize is pending (the plugin has called
+ // SetSize but we haven't actually painted it yet), or the current size of
+ // no resize is pending.
+ Size GetEffectiveSize() const;
+
private:
// Disallow copy and assign (these are unimplemented).
PaintManager(const PaintManager&);
@@ -200,6 +209,12 @@
// See comment for EnsureCallbackPending for more on how these work.
bool manual_callback_pending_;
bool flush_pending_;
+
+ // When we get a resize, we don't bind right away (see SetSize). The
+ // has_pending_resize_ tells us that we need to do a resize for the next
+ // paint operation. When true, the new size is in pending_size_.
+ bool has_pending_resize_;
+ Size pending_size_;
};
} // namespace pp
« no previous file with comments | « no previous file | ppapi/cpp/paint_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698