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

Unified Diff: ui/gfx/screen_compatible_dc_win.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, 10 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 | « ui/gfx/render_text_win.cc ('k') | ui/gfx/screen_compatible_dc_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/screen_compatible_dc_win.h
===================================================================
--- ui/gfx/screen_compatible_dc_win.h (revision 0)
+++ ui/gfx/screen_compatible_dc_win.h (revision 0)
@@ -0,0 +1,32 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UI_GFX_SCREEN_COMPATIBLE_DC_WIN_H_
+#define UI_GFX_SCREEN_COMPATIBLE_DC_WIN_H_
+#pragma once
+
+#include <windows.h>
+
+#include "base/basictypes.h"
+
+namespace gfx {
+
+// Temporary device context that is compatible with the screen. Can be used for
+// short-lived operations on the UI threads.
+class ScopedTemporaryScreenCompatibleDC {
+ public:
+ ScopedTemporaryScreenCompatibleDC();
+ ~ScopedTemporaryScreenCompatibleDC();
+
+ HDC get() const { return hdc_; }
+
+ private:
+ HDC hdc_;
+
+ DISALLOW_COPY_AND_ASSIGN(ScopedTemporaryScreenCompatibleDC);
+};
+
+} // namespace gfx
+
+#endif // UI_GFX_SCREEN_COMPATIBLE_DC_WIN_H_
« no previous file with comments | « ui/gfx/render_text_win.cc ('k') | ui/gfx/screen_compatible_dc_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698