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

Side by Side Diff: views/background.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | views/background.cc » ('j') | views/background.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef VIEWS_BACKGROUND_H_ 5 #ifndef VIEWS_BACKGROUND_H_
6 #define VIEWS_BACKGROUND_H_ 6 #define VIEWS_BACKGROUND_H_
7 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // Returns the "background color". This is equivalent to the color set in 77 // Returns the "background color". This is equivalent to the color set in
78 // SetNativeControlColor(). For solid backgrounds, this is the color; for 78 // SetNativeControlColor(). For solid backgrounds, this is the color; for
79 // gradient backgrounds, it's the midpoint of the gradient; for painter 79 // gradient backgrounds, it's the midpoint of the gradient; for painter
80 // backgrounds, this is not useful (returns a default color). 80 // backgrounds, this is not useful (returns a default color).
81 SkColor get_color() const { return color_; } 81 SkColor get_color() const { return color_; }
82 82
83 #if defined(OS_WIN) 83 #if defined(OS_WIN)
84 // TODO(port): Make GetNativeControlBrush portable (currently uses HBRUSH). 84 // TODO(port): Make GetNativeControlBrush portable (currently uses HBRUSH).
85 85
86 // Get the brush that was specified by SetNativeControlColor 86 // Get the brush that was specified by SetNativeControlColor
87 HBRUSH GetNativeControlBrush() const { return native_control_brush_; }; 87 HBRUSH GetNativeControlBrush() const;
88 #endif // defined(OS_WIN) 88 #endif // defined(OS_WIN)
89 89
90 private: 90 private:
91 SkColor color_; 91 SkColor color_;
92 #if defined(OS_WIN) 92 #if defined(OS_WIN)
93 // TODO(port): Create portable replacement for HBRUSH. 93 // TODO(port): Create portable replacement for HBRUSH.
94 HBRUSH native_control_brush_; 94 mutable HBRUSH native_control_brush_;
95 #endif // defined(OS_WIN) 95 #endif // defined(OS_WIN)
96 96
97 DISALLOW_COPY_AND_ASSIGN(Background); 97 DISALLOW_COPY_AND_ASSIGN(Background);
98 }; 98 };
99 99
100 } // namespace views 100 } // namespace views
101 101
102 #endif // VIEWS_BACKGROUND_H_ 102 #endif // VIEWS_BACKGROUND_H_
OLDNEW
« no previous file with comments | « no previous file | views/background.cc » ('j') | views/background.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698