Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 SkCanvas; | 15 class SkCanvas; |
| 16 | 16 |
| 17 namespace cc { | 17 namespace cc { |
| 18 | 18 |
| 19 class PrioritizedResource; | 19 class PrioritizedResource; |
| 20 | 20 |
| 21 struct CC_EXPORT ResourceUpdate { | 21 struct CC_EXPORT ResourceUpdate { |
| 22 static ResourceUpdate Create(PrioritizedResource* resource, | 22 static ResourceUpdate Create(PrioritizedResource* texture, |
|
danakj
2014/01/08 17:49:59
They should both be named resource rather than bot
enne (OOO)
2014/01/08 17:51:45
Nope. resource != texture. We call this a textur
simonhong
2014/01/09 04:36:25
Done.
| |
| 23 const SkBitmap* bitmap, | 23 const SkBitmap* bitmap, |
| 24 gfx::Rect content_rect, | 24 gfx::Rect content_rect, |
| 25 gfx::Rect source_rect, | 25 gfx::Rect source_rect, |
| 26 gfx::Vector2d dest_offset); | 26 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 | 27 |
| 33 ResourceUpdate(); | 28 ResourceUpdate(); |
| 34 virtual ~ResourceUpdate(); | 29 virtual ~ResourceUpdate(); |
| 35 | 30 |
| 36 PrioritizedResource* texture; | 31 PrioritizedResource* texture; |
| 37 const SkBitmap* bitmap; | 32 const SkBitmap* bitmap; |
| 38 skia::RefPtr<SkCanvas> canvas; | |
| 39 gfx::Rect content_rect; | 33 gfx::Rect content_rect; |
| 40 gfx::Rect source_rect; | 34 gfx::Rect source_rect; |
| 41 gfx::Vector2d dest_offset; | 35 gfx::Vector2d dest_offset; |
| 42 }; | 36 }; |
| 43 | 37 |
| 44 } // namespace cc | 38 } // namespace cc |
| 45 | 39 |
| 46 #endif // CC_RESOURCES_RESOURCE_UPDATE_H_ | 40 #endif // CC_RESOURCES_RESOURCE_UPDATE_H_ |
| OLD | NEW |