OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 CC_RESOURCES_RESOURCE_UPDATE_H_ | 5 #ifndef CC_RESOURCES_RESOURCE_UPDATE_H_ |
6 #define CC_RESOURCES_RESOURCE_UPDATE_H_ | 6 #define CC_RESOURCES_RESOURCE_UPDATE_H_ |
7 | 7 |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "cc/base/cc_export.h" | 9 #include "cc/base/cc_export.h" |
10 #include "skia/ext/refptr.h" | 10 #include "skia/ext/refptr.h" |
11 #include "ui/gfx/rect.h" | 11 #include "ui/gfx/rect.h" |
12 #include "ui/gfx/vector2d.h" | 12 #include "ui/gfx/vector2d.h" |
13 | 13 |
14 class SkBitmap; | 14 class SkBitmap; |
15 class SkPicture; | |
16 class SkCanvas; | 15 class SkCanvas; |
17 | 16 |
18 namespace cc { | 17 namespace cc { |
19 | 18 |
20 class PrioritizedResource; | 19 class PrioritizedResource; |
21 | 20 |
22 struct CC_EXPORT ResourceUpdate { | 21 struct CC_EXPORT ResourceUpdate { |
23 static ResourceUpdate Create(PrioritizedResource* resource, | 22 static ResourceUpdate Create(PrioritizedResource* resource, |
24 const SkBitmap* bitmap, | 23 const SkBitmap* bitmap, |
25 gfx::Rect content_rect, | 24 gfx::Rect content_rect, |
26 gfx::Rect source_rect, | 25 gfx::Rect source_rect, |
27 gfx::Vector2d dest_offset); | 26 gfx::Vector2d dest_offset); |
28 static ResourceUpdate CreateFromCanvas(PrioritizedResource* resource, | 27 static ResourceUpdate CreateFromCanvas(PrioritizedResource* resource, |
29 const skia::RefPtr<SkCanvas>& canvas, | 28 const skia::RefPtr<SkCanvas>& canvas, |
30 gfx::Rect content_rect, | 29 gfx::Rect content_rect, |
31 gfx::Rect source_rect, | 30 gfx::Rect source_rect, |
32 gfx::Vector2d dest_offset); | 31 gfx::Vector2d dest_offset); |
33 static ResourceUpdate CreateFromPicture(PrioritizedResource* resource, | |
34 SkPicture* bitmap, | |
35 gfx::Rect content_rect, | |
36 gfx::Rect source_rect, | |
37 gfx::Vector2d dest_offset); | |
38 | 32 |
39 ResourceUpdate(); | 33 ResourceUpdate(); |
40 virtual ~ResourceUpdate(); | 34 virtual ~ResourceUpdate(); |
41 | 35 |
42 PrioritizedResource* texture; | 36 PrioritizedResource* texture; |
43 const SkBitmap* bitmap; | 37 const SkBitmap* bitmap; |
44 SkPicture* picture; | |
45 skia::RefPtr<SkCanvas> canvas; | 38 skia::RefPtr<SkCanvas> canvas; |
46 gfx::Rect content_rect; | 39 gfx::Rect content_rect; |
47 gfx::Rect source_rect; | 40 gfx::Rect source_rect; |
48 gfx::Vector2d dest_offset; | 41 gfx::Vector2d dest_offset; |
49 }; | 42 }; |
50 | 43 |
51 } // namespace cc | 44 } // namespace cc |
52 | 45 |
53 #endif // CC_RESOURCES_RESOURCE_UPDATE_H_ | 46 #endif // CC_RESOURCES_RESOURCE_UPDATE_H_ |
OLD | NEW |