OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ANDROID_RESOURCES_CRUSHED_SPRITE_RESOURCE_H_ | 5 #ifndef UI_ANDROID_RESOURCES_CRUSHED_SPRITE_RESOURCE_H_ |
6 #define UI_ANDROID_RESOURCES_CRUSHED_SPRITE_RESOURCE_H_ | 6 #define UI_ANDROID_RESOURCES_CRUSHED_SPRITE_RESOURCE_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
11 | 11 |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "third_party/skia/include/core/SkBitmap.h" | 13 #include "third_party/skia/include/core/SkBitmap.h" |
14 #include "ui/android/ui_android_export.h" | 14 #include "ui/android/ui_android_export.h" |
15 #include "ui/gfx/geometry/rect.h" | 15 #include "ui/gfx/geometry/rect.h" |
16 | 16 |
17 namespace cc { | 17 namespace cc { |
18 class LayerTreeHost; | |
19 typedef int UIResourceId; | 18 typedef int UIResourceId; |
20 } | 19 } |
21 | 20 |
22 namespace gfx { | |
23 class JavaBitmap; | |
24 } | |
25 | |
26 namespace ui { | 21 namespace ui { |
27 | 22 |
28 // A resource that provides an unscaled bitmap and corresponding metadata for a | 23 // A resource that provides an unscaled bitmap and corresponding metadata for a |
29 // crushed sprite. A crushed sprite animation is run by drawing rectangles from | 24 // crushed sprite. A crushed sprite animation is run by drawing rectangles from |
30 // a bitmap to a canvas. Each frame in the animation draws its rectangles on top | 25 // a bitmap to a canvas. Each frame in the animation draws its rectangles on top |
31 // of the previous frame. | 26 // of the previous frame. |
32 class UI_ANDROID_EXPORT CrushedSpriteResource { | 27 class UI_ANDROID_EXPORT CrushedSpriteResource { |
33 public: | 28 public: |
34 typedef std::vector<std::pair<gfx::Rect, gfx::Rect>> FrameSrcDstRects; | 29 typedef std::vector<std::pair<gfx::Rect, gfx::Rect>> FrameSrcDstRects; |
35 typedef std::vector<FrameSrcDstRects> SrcDstRects; | 30 typedef std::vector<FrameSrcDstRects> SrcDstRects; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 SrcDstRects src_dst_rects_; | 73 SrcDstRects src_dst_rects_; |
79 gfx::Size unscaled_sprite_size_; | 74 gfx::Size unscaled_sprite_size_; |
80 gfx::Size scaled_sprite_size_; | 75 gfx::Size scaled_sprite_size_; |
81 | 76 |
82 DISALLOW_COPY_AND_ASSIGN(CrushedSpriteResource); | 77 DISALLOW_COPY_AND_ASSIGN(CrushedSpriteResource); |
83 }; | 78 }; |
84 | 79 |
85 } // namespace ui | 80 } // namespace ui |
86 | 81 |
87 #endif // UI_ANDROID_RESOURCES_CRUSHED_SPRITE_RESOURCE_H_ | 82 #endif // UI_ANDROID_RESOURCES_CRUSHED_SPRITE_RESOURCE_H_ |
OLD | NEW |