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

Unified Diff: views/background.cc

Issue 7065013: Makes Background only create a brush when needed. This avoids (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 7 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 | « views/background.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/background.cc
diff --git a/views/background.cc b/views/background.cc
index 1c374e4e5a0101e48a80349effe7264a4728f2be..bf08ae834a0f67b5994085d76755acca33bca41c 100644
--- a/views/background.cc
+++ b/views/background.cc
@@ -75,10 +75,17 @@ void Background::SetNativeControlColor(SkColor color) {
color_ = color;
#if defined(OS_WIN)
DeleteObject(native_control_brush_);
Ben Goodger (Google) 2011/05/24 02:09:48 Should this also set native_control_brush_ back to
sky 2011/05/24 18:13:50 Definitely. Fixed.
- native_control_brush_ = CreateSolidBrush(skia::SkColorToCOLORREF(color));
#endif
}
+#if defined(OS_WIN)
+HBRUSH Background::GetNativeControlBrush() const {
+ if (!native_control_brush_)
+ native_control_brush_ = CreateSolidBrush(skia::SkColorToCOLORREF(color_));
+ return native_control_brush_;
+}
+#endif
+
//static
Background* Background::CreateSolidBackground(const SkColor& color) {
return new SolidBackground(color);
« no previous file with comments | « views/background.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698