| 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 | 5 |
| 6 #include "config.h" | 6 #include "config.h" |
| 7 | 7 |
| 8 #if USE(ACCELERATED_COMPOSITING) | 8 #if USE(ACCELERATED_COMPOSITING) |
| 9 | 9 |
| 10 #include "FrameBufferSkPictureCanvasLayerTextureUpdater.h" | 10 #include "FrameBufferSkPictureCanvasLayerTextureUpdater.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 textureDesc.fFlags = kRenderTarget_GrPlatformTextureFlag; | 29 textureDesc.fFlags = kRenderTarget_GrPlatformTextureFlag; |
| 30 textureDesc.fWidth = canvasSize.width(); | 30 textureDesc.fWidth = canvasSize.width(); |
| 31 textureDesc.fHeight = canvasSize.height(); | 31 textureDesc.fHeight = canvasSize.height(); |
| 32 textureDesc.fConfig = kSkia8888_GrPixelConfig; | 32 textureDesc.fConfig = kSkia8888_GrPixelConfig; |
| 33 textureDesc.fTextureHandle = textureId; | 33 textureDesc.fTextureHandle = textureId; |
| 34 SkAutoTUnref<GrTexture> target(grContext->createPlatformTexture(textureDesc)
); | 34 SkAutoTUnref<GrTexture> target(grContext->createPlatformTexture(textureDesc)
); |
| 35 SkAutoTUnref<SkDevice> device(new SkGpuDevice(grContext, target.get())); | 35 SkAutoTUnref<SkDevice> device(new SkGpuDevice(grContext, target.get())); |
| 36 return adoptPtr(new SkCanvas(device.get())); | 36 return adoptPtr(new SkCanvas(device.get())); |
| 37 } | 37 } |
| 38 | 38 |
| 39 FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::Texture(FrameBufferSkPic
tureCanvasLayerTextureUpdater* textureUpdater, PassOwnPtr<CCPrioritizedTexture>
texture) | 39 FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::Texture(FrameBufferSkPic
tureCanvasLayerTextureUpdater* textureUpdater, scoped_ptr<CCPrioritizedTexture>
texture) |
| 40 : LayerTextureUpdater::Texture(texture) | 40 : LayerTextureUpdater::Texture(texture.Pass()) |
| 41 , m_textureUpdater(textureUpdater) | 41 , m_textureUpdater(textureUpdater) |
| 42 { | 42 { |
| 43 } | 43 } |
| 44 | 44 |
| 45 FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::~Texture() | 45 FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::~Texture() |
| 46 { | 46 { |
| 47 } | 47 } |
| 48 | 48 |
| 49 void FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::updateRect(CCResour
ceProvider* resourceProvider, const IntRect& sourceRect, const IntSize& destOffs
et) | 49 void FrameBufferSkPictureCanvasLayerTextureUpdater::Texture::updateRect(CCResour
ceProvider* resourceProvider, const IntRect& sourceRect, const IntSize& destOffs
et) |
| 50 { | 50 { |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 | 110 |
| 111 // Flush ganesh context so that all the rendered stuff appears on the textur
e. | 111 // Flush ganesh context so that all the rendered stuff appears on the textur
e. |
| 112 grContext->flush(); | 112 grContext->flush(); |
| 113 | 113 |
| 114 // Flush the GL context so rendering results from this context are visible i
n the compositor's context. | 114 // Flush the GL context so rendering results from this context are visible i
n the compositor's context. |
| 115 context->flush(); | 115 context->flush(); |
| 116 } | 116 } |
| 117 | 117 |
| 118 } // namespace cc | 118 } // namespace cc |
| 119 #endif // USE(ACCELERATED_COMPOSITING) | 119 #endif // USE(ACCELERATED_COMPOSITING) |
| OLD | NEW |