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

Side by Side Diff: app/theme_provider.h

Issue 288005: First fix to minimize copying of image data. (Closed)
Patch Set: Modify gyp Created 11 years, 2 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
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 APP_THEME_PROVIDER_H_ 5 #ifndef APP_THEME_PROVIDER_H_
6 #define APP_THEME_PROVIDER_H_ 6 #define APP_THEME_PROVIDER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "third_party/skia/include/core/SkColor.h" 11 #include "third_party/skia/include/core/SkColor.h"
12 12
13 #if defined(OS_LINUX) 13 #if defined(OS_LINUX)
14 #include <gdk/gdk.h> 14 #include <gdk/gdk.h>
15 #elif defined(OS_MACOSX) 15 #elif defined(OS_MACOSX)
16 #ifdef __OBJC__ 16 #ifdef __OBJC__
17 @class NSColor; 17 @class NSColor;
18 @class NSImage; 18 @class NSImage;
19 #else 19 #else
20 class NSColor; 20 class NSColor;
21 class NSImage; 21 class NSImage;
22 #endif // __OBJC__ 22 #endif // __OBJC__
23 #endif // OS_* 23 #endif // OS_*
24 24
25 class Profile; 25 class Profile;
26 class RefCountedMemory;
26 class SkBitmap; 27 class SkBitmap;
27 28
28 //////////////////////////////////////////////////////////////////////////////// 29 ////////////////////////////////////////////////////////////////////////////////
29 // 30 //
30 // ThemeProvider 31 // ThemeProvider
31 // 32 //
32 // ThemeProvider is an abstract class that defines the API that should be 33 // ThemeProvider is an abstract class that defines the API that should be
33 // implemented to provide bitmaps and color information for a given theme. 34 // implemented to provide bitmaps and color information for a given theme.
34 // 35 //
35 //////////////////////////////////////////////////////////////////////////////// 36 ////////////////////////////////////////////////////////////////////////////////
(...skipping 17 matching lines...) Expand all
53 virtual bool GetDisplayProperty(int id, int* result) const = 0; 54 virtual bool GetDisplayProperty(int id, int* result) const = 0;
54 55
55 // Whether we should use the native system frame (typically Aero glass) or 56 // Whether we should use the native system frame (typically Aero glass) or
56 // a custom frame. 57 // a custom frame.
57 virtual bool ShouldUseNativeFrame() const = 0; 58 virtual bool ShouldUseNativeFrame() const = 0;
58 59
59 // Whether or not we have a certain image. Used for when the default theme 60 // Whether or not we have a certain image. Used for when the default theme
60 // doesn't provide a certain image, but custom themes might (badges, etc). 61 // doesn't provide a certain image, but custom themes might (badges, etc).
61 virtual bool HasCustomImage(int id) const = 0; 62 virtual bool HasCustomImage(int id) const = 0;
62 63
63 // Reads the image data from the theme file into the specified vector. Returns 64 // Reads the image data from the theme file into the specified
64 // true on success. 65 // vector. Returns NULL on error.
65 virtual bool GetRawData(int id, 66 virtual RefCountedMemory* GetRawData(int id) const = 0;
66 std::vector<unsigned char>* raw_data) const = 0;
67 67
68 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS) 68 #if defined(OS_LINUX) && !defined(TOOLKIT_VIEWS)
69 // Gets the GdkPixbuf with the specified |id|. Returns a pointer to a shared 69 // Gets the GdkPixbuf with the specified |id|. Returns a pointer to a shared
70 // instance of the GdkPixbuf. This shared GdkPixbuf is owned by the theme 70 // instance of the GdkPixbuf. This shared GdkPixbuf is owned by the theme
71 // provider and should not be freed. 71 // provider and should not be freed.
72 // 72 //
73 // The bitmap is assumed to exist. This function will log in release, and 73 // The bitmap is assumed to exist. This function will log in release, and
74 // assert in debug mode if it does not. On failure, this will return a 74 // assert in debug mode if it does not. On failure, this will return a
75 // pointer to a shared empty placeholder bitmap so it will be visible what 75 // pointer to a shared empty placeholder bitmap so it will be visible what
76 // is missing. 76 // is missing.
(...skipping 16 matching lines...) Expand all
93 93
94 // Gets the NSColor for tinting with the specified |id|. 94 // Gets the NSColor for tinting with the specified |id|.
95 // 95 //
96 // The tint is not assumed to exist. If a theme does not provide a tint with 96 // The tint is not assumed to exist. If a theme does not provide a tint with
97 // that id, this function will return nil. 97 // that id, this function will return nil.
98 virtual NSColor* GetNSColorTint(int id) const = 0; 98 virtual NSColor* GetNSColorTint(int id) const = 0;
99 #endif 99 #endif
100 }; 100 };
101 101
102 #endif // APP_THEME_PROVIDER_H_ 102 #endif // APP_THEME_PROVIDER_H_
OLDNEW
« no previous file with comments | « app/resource_bundle_win.cc ('k') | base/base.gyp » ('j') | base/ref_counted_memory.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698