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 "cc/resources/image_layer_updater.h" | 5 #include "cc/resources/image_layer_updater.h" |
6 #include "cc/resources/prioritized_resource.h" | 6 #include "cc/resources/prioritized_resource.h" |
7 #include "cc/resources/resource_update_queue.h" | 7 #include "cc/resources/resource_update_queue.h" |
8 | 8 |
9 namespace cc { | 9 namespace cc { |
10 | 10 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 gfx::Vector2d(clipped_source_rect.origin() - source_rect.origin()); | 49 gfx::Vector2d(clipped_source_rect.origin() - source_rect.origin()); |
50 | 50 |
51 ResourceUpdate upload = ResourceUpdate::Create( | 51 ResourceUpdate upload = ResourceUpdate::Create( |
52 texture, &bitmap_, image_rect, clipped_source_rect, clipped_dest_offset); | 52 texture, &bitmap_, image_rect, clipped_source_rect, clipped_dest_offset); |
53 if (partial_update) | 53 if (partial_update) |
54 queue->AppendPartialUpload(upload); | 54 queue->AppendPartialUpload(upload); |
55 else | 55 else |
56 queue->AppendFullUpload(upload); | 56 queue->AppendFullUpload(upload); |
57 } | 57 } |
58 | 58 |
| 59 void ImageLayerUpdater::SetBitmap(const SkBitmap& bitmap) { |
| 60 DCHECK(bitmap.pixelRef()); |
| 61 bitmap_ = bitmap; |
| 62 } |
| 63 |
| 64 bool ImageLayerUpdater::UsingBitmap(const SkBitmap& bitmap) const { |
| 65 return bitmap.pixelRef() == bitmap_.pixelRef(); |
| 66 } |
| 67 |
59 } // namespace cc | 68 } // namespace cc |
OLD | NEW |