| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_ANDROID_H_ | 5 #ifndef UI_BASE_NATIVE_THEME_NATIVE_THEME_ANDROID_H_ |
| 6 #define UI_BASE_NATIVE_THEME_NATIVE_THEME_ANDROID_H_ | 6 #define UI_BASE_NATIVE_THEME_NATIVE_THEME_ANDROID_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| 11 #include "skia/ext/platform_canvas.h" | 11 #include "skia/ext/platform_canvas.h" |
| 12 #include "ui/base/native_theme/native_theme.h" | 12 #include "ui/base/native_theme/native_theme.h" |
| 13 | 13 |
| 14 namespace gfx { | 14 namespace gfx { |
| 15 class ImageSkia; |
| 15 class Rect; | 16 class Rect; |
| 16 class Size; | 17 class Size; |
| 17 } | 18 } |
| 18 | 19 |
| 19 namespace ui { | 20 namespace ui { |
| 20 | 21 |
| 21 // Android theming API. | 22 // Android theming API. |
| 22 class NativeThemeAndroid : public NativeTheme { | 23 class NativeThemeAndroid : public NativeTheme { |
| 23 public: | 24 public: |
| 24 // Gets our singleton instance. | 25 // Gets our singleton instance. |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 const ProgressBarExtraParams& progress_bar) const; | 106 const ProgressBarExtraParams& progress_bar) const; |
| 106 | 107 |
| 107 // Return true if there is intersection between the |canvas| and the given | 108 // Return true if there is intersection between the |canvas| and the given |
| 108 // rectangle. | 109 // rectangle. |
| 109 bool IntersectsClipRectInt(SkCanvas* canvas, | 110 bool IntersectsClipRectInt(SkCanvas* canvas, |
| 110 int x, | 111 int x, |
| 111 int y, | 112 int y, |
| 112 int w, | 113 int w, |
| 113 int h) const; | 114 int h) const; |
| 114 | 115 |
| 115 // Draw the dest rectangle with the given bitmap which might be scaled if its | 116 // Draw the dest rectangle with the given image which might be scaled if its |
| 116 // size is not same as target rectangle. | 117 // size is not same as target rectangle. |
| 117 void DrawBitmapInt(SkCanvas* canvas, | 118 void DrawBitmapInt(SkCanvas* canvas, |
| 118 const SkBitmap& bitmap, | 119 const gfx::ImageSkia& image, |
| 119 int src_x, | 120 int src_x, |
| 120 int src_y, | 121 int src_y, |
| 121 int src_w, | 122 int src_w, |
| 122 int src_h, | 123 int src_h, |
| 123 int dest_x, | 124 int dest_x, |
| 124 int dest_y, | 125 int dest_y, |
| 125 int dest_w, | 126 int dest_w, |
| 126 int dest_h) const; | 127 int dest_h) const; |
| 127 | 128 |
| 128 // Draw the target rectangle with the |bitmap| accroding the given | 129 // Draw the target rectangle with the |bitmap| accroding the given |
| 129 // |tile_scale_x| and |tile_scale_y| | 130 // |tile_scale_x| and |tile_scale_y| |
| 130 void DrawTiledImage(SkCanvas* canvas, | 131 void DrawTiledImage(SkCanvas* canvas, |
| 131 const SkBitmap& bitmap, | 132 const gfx::ImageSkia& image, |
| 132 int src_x, | 133 int src_x, |
| 133 int src_y, | 134 int src_y, |
| 134 float tile_scale_x, | 135 float tile_scale_x, |
| 135 float tile_scale_y, | 136 float tile_scale_y, |
| 136 int dest_x, | 137 int dest_x, |
| 137 int dest_y, | 138 int dest_y, |
| 138 int w, | 139 int w, |
| 139 int h) const; | 140 int h) const; |
| 140 | 141 |
| 141 // Return a new color which comes from the |hsv| by adjusting saturate and | 142 // Return a new color which comes from the |hsv| by adjusting saturate and |
| (...skipping 25 matching lines...) Expand all Loading... |
| 167 // Used to return the color of scrollbar based on the color of thumb and | 168 // Used to return the color of scrollbar based on the color of thumb and |
| 168 // track. | 169 // track. |
| 169 SkColor OutlineColor(SkScalar* hsv1, SkScalar* hsv2) const; | 170 SkColor OutlineColor(SkScalar* hsv1, SkScalar* hsv2) const; |
| 170 | 171 |
| 171 DISALLOW_COPY_AND_ASSIGN(NativeThemeAndroid); | 172 DISALLOW_COPY_AND_ASSIGN(NativeThemeAndroid); |
| 172 }; | 173 }; |
| 173 | 174 |
| 174 } // namespace ui | 175 } // namespace ui |
| 175 | 176 |
| 176 #endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_ANDROID_H_ | 177 #endif // UI_BASE_NATIVE_THEME_NATIVE_THEME_ANDROID_H_ |
| OLD | NEW |