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/image_layer_updater.h" | 5 #include "cc/image_layer_updater.h" |
| 6 #include "cc/prioritized_resource.h" |
6 #include "cc/resource_update_queue.h" | 7 #include "cc/resource_update_queue.h" |
7 | 8 |
8 namespace cc { | 9 namespace cc { |
9 | 10 |
| 11 ImageLayerUpdater::Resource::Resource(ImageLayerUpdater* updater, scoped_ptr<Pri
oritizedResource> texture) |
| 12 : LayerUpdater::Resource(texture.Pass()) |
| 13 , m_updater(updater) |
| 14 { |
| 15 } |
| 16 |
| 17 ImageLayerUpdater::Resource::~Resource() |
| 18 { |
| 19 } |
| 20 |
10 void ImageLayerUpdater::Resource::update(ResourceUpdateQueue& queue, const gfx::
Rect& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate, Rendering
Stats&) | 21 void ImageLayerUpdater::Resource::update(ResourceUpdateQueue& queue, const gfx::
Rect& sourceRect, const gfx::Vector2d& destOffset, bool partialUpdate, Rendering
Stats&) |
11 { | 22 { |
12 m_updater->updateTexture(queue, texture(), sourceRect, destOffset, partialUp
date); | 23 m_updater->updateTexture(queue, texture(), sourceRect, destOffset, partialUp
date); |
13 } | 24 } |
14 | 25 |
15 // static | 26 // static |
16 scoped_refptr<ImageLayerUpdater> ImageLayerUpdater::create() | 27 scoped_refptr<ImageLayerUpdater> ImageLayerUpdater::create() |
17 { | 28 { |
18 return make_scoped_refptr(new ImageLayerUpdater()); | 29 return make_scoped_refptr(new ImageLayerUpdater()); |
19 } | 30 } |
(...skipping 24 matching lines...) Expand all Loading... |
44 else | 55 else |
45 queue.appendFullUpload(upload); | 56 queue.appendFullUpload(upload); |
46 } | 57 } |
47 | 58 |
48 void ImageLayerUpdater::setBitmap(const SkBitmap& bitmap) | 59 void ImageLayerUpdater::setBitmap(const SkBitmap& bitmap) |
49 { | 60 { |
50 m_bitmap = bitmap; | 61 m_bitmap = bitmap; |
51 } | 62 } |
52 | 63 |
53 } | 64 } |
OLD | NEW |