Index: chrome/common/extensions/icon_transform.h |
diff --git a/chrome/common/extensions/icon_transform.h b/chrome/common/extensions/icon_transform.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0de07c0c07c8ccf83a2cb0cbc6a43d598b85dd62 |
--- /dev/null |
+++ b/chrome/common/extensions/icon_transform.h |
@@ -0,0 +1,43 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_COMMON_EXTENSIONS_ICON_TRANSFORM_H_ |
+#define CHROME_COMMON_EXTENSIONS_ICON_TRANSFORM_H_ |
+#pragma once |
+ |
+#include "base/memory/scoped_ptr.h" |
+ |
+class SkBitmap; |
+class SkDevice; |
+ |
+namespace extensions { |
+ |
+// A container for a mutable SkBitmap. |
+class IconTransform { |
+ public: |
+ IconTransform(); |
+ ~IconTransform(); |
+ |
+ // Renders |icon| with the transformations applied. |
+ const SkBitmap& RenderIcon(const SkBitmap& icon); |
+ |
+ // Sets the transform's |alpha| to a value between 0 and 255. |
+ // Returns a reference to this. |
+ IconTransform& set_alpha(int alpha) { |
+ alpha_ = alpha; |
+ return *this; |
+ } |
+ |
+ private: |
+ // The alpha. |
+ int alpha_; |
+ |
+ // Device used to paint the icon to. |
+ scoped_ptr<SkDevice> device_; |
+}; |
+ |
+} // namespace extensions |
+ |
+ |
+#endif // CHROME_COMMON_EXTENSIONS_ICON_TRANSFORM_H_ |