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 #include "config.h" | 5 #include "config.h" |
6 | 6 |
7 #include "cc/resource_update.h" | 7 #include "cc/resource_update.h" |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 ResourceUpdate ResourceUpdate::Create(PrioritizedTexture* texture, | 13 ResourceUpdate ResourceUpdate::Create(PrioritizedTexture* texture, |
14 const SkBitmap* bitmap, | 14 const SkBitmap* bitmap, |
15 IntRect content_rect, | 15 gfx::Rect content_rect, |
16 IntRect source_rect, | 16 gfx::Rect source_rect, |
17 IntSize dest_offset) { | 17 gfx::Vector2d dest_offset) { |
18 CHECK(content_rect.contains(source_rect)); | 18 CHECK(content_rect.Contains(source_rect)); |
19 ResourceUpdate update; | 19 ResourceUpdate update; |
20 update.texture = texture; | 20 update.texture = texture; |
21 update.bitmap = bitmap; | 21 update.bitmap = bitmap; |
22 update.content_rect = content_rect; | 22 update.content_rect = content_rect; |
23 update.source_rect = source_rect; | 23 update.source_rect = source_rect; |
24 update.dest_offset = dest_offset; | 24 update.dest_offset = dest_offset; |
25 return update; | 25 return update; |
26 } | 26 } |
27 | 27 |
28 ResourceUpdate ResourceUpdate::CreateFromPicture(PrioritizedTexture* texture, | 28 ResourceUpdate ResourceUpdate::CreateFromPicture(PrioritizedTexture* texture, |
29 SkPicture* picture, | 29 SkPicture* picture, |
30 IntRect content_rect, | 30 gfx::Rect content_rect, |
31 IntRect source_rect, | 31 gfx::Rect source_rect, |
32 IntSize dest_offset) { | 32 gfx::Vector2d dest_offset) { |
33 CHECK(content_rect.contains(source_rect)); | 33 CHECK(content_rect.Contains(source_rect)); |
34 ResourceUpdate update; | 34 ResourceUpdate update; |
35 update.texture = texture; | 35 update.texture = texture; |
36 update.picture = picture; | 36 update.picture = picture; |
37 update.content_rect = content_rect; | 37 update.content_rect = content_rect; |
38 update.source_rect = source_rect; | 38 update.source_rect = source_rect; |
39 update.dest_offset = dest_offset; | 39 update.dest_offset = dest_offset; |
40 return update; | 40 return update; |
41 } | 41 } |
42 | 42 |
43 ResourceUpdate::ResourceUpdate() | 43 ResourceUpdate::ResourceUpdate() |
44 : texture(NULL), | 44 : texture(NULL), |
45 bitmap(NULL), | 45 bitmap(NULL), |
46 picture(NULL) { | 46 picture(NULL) { |
47 } | 47 } |
48 | 48 |
49 ResourceUpdate::~ResourceUpdate() { | 49 ResourceUpdate::~ResourceUpdate() { |
50 } | 50 } |
51 | 51 |
52 } // namespace cc | 52 } // namespace cc |
OLD | NEW |