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

Unified Diff: ui/gfx/image/image_skia_operations.h

Issue 10704199: Implement remaining SkBitmapOperations as ImageSkiaOperations (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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 | « ui/gfx/image/image_skia.cc ('k') | ui/gfx/image/image_skia_operations.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/image/image_skia_operations.h
diff --git a/ui/gfx/image/image_skia_operations.h b/ui/gfx/image/image_skia_operations.h
index 1e6a52a66694c6a1735f65f4f9968db518222461..993655ca0ef5acc4127a14197b897b063fd749ca 100644
--- a/ui/gfx/image/image_skia_operations.h
+++ b/ui/gfx/image/image_skia_operations.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_
-#define UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_
+#ifndef UI_GFX_IMAGE_SKIA_OPERATIONS_H_
+#define UI_GFX_IMAGE_SKIA_OPERATIONS_H_
#include "base/gtest_prod_util.h"
#include "ui/base/ui_export.h"
@@ -11,6 +11,7 @@
namespace gfx {
class ImageSkia;
+class Rect;
class Size;
class UI_EXPORT ImageSkiaOperations {
@@ -35,6 +36,20 @@ class UI_EXPORT ImageSkiaOperations {
int src_x, int src_y,
int dst_w, int dst_h);
+ // Creates a button background image by compositing the color and image
+ // together, then applying the mask. This is a highly specialized composite
+ // operation that is the equivalent of drawing a background in |color|,
+ // tiling |image| over the top, and then masking the result out with |mask|.
+ // The images must use kARGB_8888_Config config.
+ static ImageSkia CreateButtonBackground(SkColor color,
+ const gfx::ImageSkia& image,
+ const gfx::ImageSkia& mask);
+
+ // Returns an image which is a subset of |image| with bounds |subset_bounds|.
+ // The |image| cannot use kA1_Config config.
+ static ImageSkia ExtractSubset(const gfx::ImageSkia& image,
+ const gfx::Rect& subset_bounds);
+
// Creates an image by resizing |source| to given |target_dip_size|.
static ImageSkia CreateResizedImage(const ImageSkia& source,
const Size& target_dip_size);
@@ -47,6 +62,6 @@ class UI_EXPORT ImageSkiaOperations {
ImageSkiaOperations(); // Class for scoping only.
};
-}
+} // namespace gfx
#endif // UI_GFX_IMAGE_IMAGE_SKIA_OPERATIONS_H_
« no previous file with comments | « ui/gfx/image/image_skia.cc ('k') | ui/gfx/image/image_skia_operations.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698