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

Unified Diff: ui/gfx/screen.h

Issue 9323011: Cache a screen compatible DC to avoid re-creating it excessively. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: . Created 8 years, 11 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
Index: ui/gfx/screen.h
===================================================================
--- ui/gfx/screen.h (revision 120215)
+++ ui/gfx/screen.h (working copy)
@@ -65,6 +65,16 @@
// number of distinct, usable displays.
static int GetNumMonitors();
+#if defined(OS_WIN)
sky 2012/02/03 18:34:06 I don't like defining this here. Move it into it's
+ // Returns a device context compatible with the screen. The context can be
+ // used as a temporary context on the UI thread.
+ static HDC GetCompatibleDC();
+
+ // Should be called on WM_DISPLAYCHANGE to release the cached compatible
+ // device context, if any.
+ static void ReleaseCompatibleDC();
+#endif
+
protected:
virtual gfx::Point GetCursorScreenPointImpl() = 0;
virtual gfx::Rect GetMonitorWorkAreaNearestWindowImpl(
@@ -83,6 +93,11 @@
// The singleton screen instance. Only used on aura.
static Screen* instance_;
#endif
+
+#if defined(OS_WIN)
+ // Cached device context compatible with the screen.
+ static HDC compatible_dc_;
+#endif
};
} // namespace gfx

Powered by Google App Engine
This is Rietveld 408576698