OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/frame_buffer_skpicture_canvas_layer_texture_updater.h" | 7 #include "cc/frame_buffer_skpicture_canvas_layer_texture_updater.h" |
8 | 8 |
9 #include "cc/layer_painter.h" | 9 #include "cc/layer_painter.h" |
10 | 10 |
11 namespace cc { | 11 namespace cc { |
12 | 12 |
13 FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::Texture(FrameBufferSkPic
tureCanvasLayerTextureUpdater* textureUpdater, scoped_ptr<CCPrioritizedTexture>
texture) | 13 FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::Texture(FrameBufferSkPic
tureCanvasLayerTextureUpdater* textureUpdater, scoped_ptr<PrioritizedTexture> te
xture) |
14 : LayerTextureUpdater::Texture(texture.Pass()) | 14 : LayerTextureUpdater::Texture(texture.Pass()) |
15 , m_textureUpdater(textureUpdater) | 15 , m_textureUpdater(textureUpdater) |
16 { | 16 { |
17 } | 17 } |
18 | 18 |
19 FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::~Texture() | 19 FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::~Texture() |
20 { | 20 { |
21 } | 21 } |
22 | 22 |
23 void FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::update(CCTextureUpd
ateQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool part
ialUpdate, CCRenderingStats&) | 23 void FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::update(TextureUpdat
eQueue& queue, const IntRect& sourceRect, const IntSize& destOffset, bool partia
lUpdate, RenderingStats&) |
24 { | 24 { |
25 textureUpdater()->updateTexture(queue, texture(), sourceRect, destOffset, pa
rtialUpdate); | 25 textureUpdater()->updateTexture(queue, texture(), sourceRect, destOffset, pa
rtialUpdate); |
26 } | 26 } |
27 | 27 |
28 scoped_refptr<FrameBufferSkPictureCanvasLayerTextureUpdater> FrameBufferSkPictur
eCanvasLayerTextureUpdater::create(scoped_ptr<LayerPainterChromium> painter) | 28 scoped_refptr<FrameBufferSkPictureCanvasLayerTextureUpdater> FrameBufferSkPictur
eCanvasLayerTextureUpdater::create(scoped_ptr<LayerPainter> painter) |
29 { | 29 { |
30 return make_scoped_refptr(new FrameBufferSkPictureCanvasLayerTextureUpdater(
painter.Pass())); | 30 return make_scoped_refptr(new FrameBufferSkPictureCanvasLayerTextureUpdater(
painter.Pass())); |
31 } | 31 } |
32 | 32 |
33 FrameBufferSkPictureCanvasLayerTextureUpdater::FrameBufferSkPictureCanvasLayerTe
xtureUpdater(scoped_ptr<LayerPainterChromium> painter) | 33 FrameBufferSkPictureCanvasLayerTextureUpdater::FrameBufferSkPictureCanvasLayerTe
xtureUpdater(scoped_ptr<LayerPainter> painter) |
34 : SkPictureCanvasLayerTextureUpdater(painter.Pass()) | 34 : SkPictureCanvasLayerTextureUpdater(painter.Pass()) |
35 { | 35 { |
36 } | 36 } |
37 | 37 |
38 FrameBufferSkPictureCanvasLayerTextureUpdater::~FrameBufferSkPictureCanvasLayerT
extureUpdater() | 38 FrameBufferSkPictureCanvasLayerTextureUpdater::~FrameBufferSkPictureCanvasLayerT
extureUpdater() |
39 { | 39 { |
40 } | 40 } |
41 | 41 |
42 scoped_ptr<LayerTextureUpdater::Texture> FrameBufferSkPictureCanvasLayerTextureU
pdater::createTexture(CCPrioritizedTextureManager* manager) | 42 scoped_ptr<LayerTextureUpdater::Texture> FrameBufferSkPictureCanvasLayerTextureU
pdater::createTexture(PrioritizedTextureManager* manager) |
43 { | 43 { |
44 return scoped_ptr<LayerTextureUpdater::Texture>(new Texture(this, CCPrioriti
zedTexture::create(manager))); | 44 return scoped_ptr<LayerTextureUpdater::Texture>(new Texture(this, Prioritize
dTexture::create(manager))); |
45 } | 45 } |
46 | 46 |
47 LayerTextureUpdater::SampledTexelFormat FrameBufferSkPictureCanvasLayerTextureUp
dater::sampledTexelFormat(GC3Denum textureFormat) | 47 LayerTextureUpdater::SampledTexelFormat FrameBufferSkPictureCanvasLayerTextureUp
dater::sampledTexelFormat(GC3Denum textureFormat) |
48 { | 48 { |
49 // Here we directly render to the texture, so the component order is always
correct. | 49 // Here we directly render to the texture, so the component order is always
correct. |
50 return LayerTextureUpdater::SampledTexelFormatRGBA; | 50 return LayerTextureUpdater::SampledTexelFormatRGBA; |
51 } | 51 } |
52 | 52 |
53 } // namespace cc | 53 } // namespace cc |
OLD | NEW |