OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_COMMON_EXTENSIONS_ICON_TRANSFORM_H_ |
| 6 #define CHROME_COMMON_EXTENSIONS_ICON_TRANSFORM_H_ |
| 7 #pragma once |
| 8 |
| 9 #include "base/memory/scoped_ptr.h" |
| 10 |
| 11 class SkBitmap; |
| 12 class SkDevice; |
| 13 |
| 14 namespace extensions { |
| 15 |
| 16 // A container for a mutable SkBitmap. |
| 17 class IconTransform { |
| 18 public: |
| 19 IconTransform(); |
| 20 ~IconTransform(); |
| 21 |
| 22 // Renders |icon| with the transformations applied. |
| 23 const SkBitmap& RenderIcon(const SkBitmap& icon); |
| 24 |
| 25 // Sets the transform's |alpha| to a value between 0 and 255. |
| 26 // Returns a reference to this. |
| 27 IconTransform& set_alpha(int alpha) { |
| 28 alpha_ = alpha; |
| 29 return *this; |
| 30 } |
| 31 |
| 32 private: |
| 33 // The alpha. |
| 34 int alpha_; |
| 35 |
| 36 // Device used to paint the icon to. |
| 37 scoped_ptr<SkDevice> device_; |
| 38 }; |
| 39 |
| 40 } // namespace extensions |
| 41 |
| 42 |
| 43 #endif // CHROME_COMMON_EXTENSIONS_ICON_TRANSFORM_H_ |
OLD | NEW |