diff options
author | lpromero <lpromero@chromium.org> | 2015-01-23 12:17:36 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-01-23 20:18:40 +0000 |
commit | a110f52e83cebd2b6f0ed37c34abeac8bfcb1b72 (patch) | |
tree | b0054fe1a2bbb25a9532fb7a1b9a1decb5b62a6d /components/enhanced_bookmarks/image_store_util.h | |
parent | 921392d21263c05b374d94ae3da3120094cd6a65 (diff) | |
download | chromium_src-a110f52e83cebd2b6f0ed37c34abeac8bfcb1b72.zip chromium_src-a110f52e83cebd2b6f0ed37c34abeac8bfcb1b72.tar.gz chromium_src-a110f52e83cebd2b6f0ed37c34abeac8bfcb1b72.tar.bz2 |
★ Record the image dominant color in the image database.
This CL adds a column in the bookmarks images database.
It contains the dominant color extracted from the image.
Since this computation can be lengthy, it is done in the background, when the
image is stored in the database.
For old databases, a migration path is provided and the dominant color is
computed and stored upon querying the image for the first time.
BUG=448443
Review URL: https://codereview.chromium.org/875463003
Cr-Commit-Position: refs/heads/master@{#312916}
Diffstat (limited to 'components/enhanced_bookmarks/image_store_util.h')
-rw-r--r-- | components/enhanced_bookmarks/image_store_util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/components/enhanced_bookmarks/image_store_util.h b/components/enhanced_bookmarks/image_store_util.h index 0b9ecaf..8537197 100644 --- a/components/enhanced_bookmarks/image_store_util.h +++ b/components/enhanced_bookmarks/image_store_util.h @@ -6,6 +6,7 @@ #define COMPONENTS_ENHANCED_BOOKMARKS_IMAGE_STORE_UTIL_H_ #include "base/memory/ref_counted_memory.h" +#include "third_party/skia/include/core/SkColor.h" #include "ui/gfx/geometry/size.h" #include "ui/gfx/image/image.h" @@ -22,6 +23,9 @@ scoped_refptr<base::RefCountedMemory> BytesForImage(const gfx::Image& image); // returns a gfx::Image. If decoding fails, returns an empty image. gfx::Image ImageForBytes(const scoped_refptr<base::RefCountedMemory>& data); +// Returns the dominant color for |image|. This method can be slow on very large +// images. +SkColor DominantColorForImage(const gfx::Image& image); } #endif // COMPONENTS_ENHANCED_BOOKMARKS_IMAGE_STORE_UTIL_H_ |