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

Unified Diff: chrome/browser/themes/custom_theme_supplier.h

Issue 1869693002: Theme suppliers: Avoid all Image copying. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 8 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 | « chrome/browser/themes/browser_theme_pack.cc ('k') | chrome/browser/themes/custom_theme_supplier.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/themes/custom_theme_supplier.h
diff --git a/chrome/browser/themes/custom_theme_supplier.h b/chrome/browser/themes/custom_theme_supplier.h
index cf4da937b08e78269e5378a2a77bc91aead18da2..f33275411a5ab1d65f6ca0f2dfd7b2cda9e9dde0 100644
--- a/chrome/browser/themes/custom_theme_supplier.h
+++ b/chrome/browser/themes/custom_theme_supplier.h
@@ -10,6 +10,7 @@
#include "content/public/browser/browser_thread.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/base/layout.h"
+#include "ui/gfx/image/image.h"
namespace base {
class RefCountedMemory;
@@ -57,7 +58,7 @@ class CustomThemeSupplier : public base::RefCountedThreadSafe<
// Returns the theme image for |id|. Returns an empty image if no image is
// found for |id|.
- virtual gfx::Image GetImageNamed(int id);
+ virtual const gfx::Image& GetImageNamed(int id);
// Returns the raw PNG encoded data for IDR_THEME_NTP_*. This method only
// works for the NTP attribution and background resources.
@@ -70,6 +71,8 @@ class CustomThemeSupplier : public base::RefCountedThreadSafe<
protected:
virtual ~CustomThemeSupplier();
+ const gfx::Image& empty_image() const { return empty_image_; }
+
private:
friend struct content::BrowserThread::DeleteOnThread<
content::BrowserThread::FILE>;
@@ -77,6 +80,8 @@ class CustomThemeSupplier : public base::RefCountedThreadSafe<
ThemeType theme_type_;
+ gfx::Image empty_image_;
+
DISALLOW_COPY_AND_ASSIGN(CustomThemeSupplier);
};
« no previous file with comments | « chrome/browser/themes/browser_theme_pack.cc ('k') | chrome/browser/themes/custom_theme_supplier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698