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