OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011 Google Inc. All rights reserved. | 2 * Copyright (C) 2011 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 case GraphicsContext3D::RGBA: | 143 case GraphicsContext3D::RGBA: |
144 drawRGBA(layerRenderer); | 144 drawRGBA(layerRenderer); |
145 break; | 145 break; |
146 case GraphicsContext3D::TEXTURE_2D: | 146 case GraphicsContext3D::TEXTURE_2D: |
147 drawNativeTexture(layerRenderer); | 147 drawNativeTexture(layerRenderer); |
148 break; | 148 break; |
149 default: | 149 default: |
150 CRASH(); // Someone updated convertVFCFormatToGC3DFormat above but updat
e this! | 150 CRASH(); // Someone updated convertVFCFormatToGC3DFormat above but updat
e this! |
151 } | 151 } |
152 | 152 |
153 for (unsigned plane = 0; plane < frame->planes(); ++plane) | 153 for (unsigned plane = 0; plane < frame->planes(); ++plane) { |
154 m_textures[plane].m_texture->unreserve(); | 154 m_textures[plane].m_texture->unreserve(); |
| 155 // FIXME: ManagedTexture's store a raw pointer to their TextureManager, |
| 156 // and the textures we create use layerRenderer->renderSurfaceTextureMan
ager(). |
| 157 // Since there is no guarantee layerRenderer will still be alive the |
| 158 // next time we are called, we clear the texture reference. It would |
| 159 // be nice if instead we could rely on textures being invalidated when |
| 160 // their manager was deleted so that new textures didn't always have to |
| 161 // be recreated for each frame. |
| 162 m_textures[plane].m_texture.clear(); |
| 163 } |
155 m_provider->putCurrentFrame(frame); | 164 m_provider->putCurrentFrame(frame); |
156 } | 165 } |
157 | 166 |
158 void CCVideoLayerImpl::appendQuads(CCQuadList& quadList, const CCSharedQuadState
* sharedQuadState) | 167 void CCVideoLayerImpl::appendQuads(CCQuadList& quadList, const CCSharedQuadState
* sharedQuadState) |
159 { | 168 { |
160 IntRect quadRect(IntPoint(), bounds()); | 169 IntRect quadRect(IntPoint(), bounds()); |
161 quadList.append(CCVideoDrawQuad::create(sharedQuadState, quadRect, this)); | 170 quadList.append(CCVideoDrawQuad::create(sharedQuadState, quadRect, this)); |
162 } | 171 } |
163 | 172 |
164 bool CCVideoLayerImpl::copyFrameToTextures(const VideoFrameChromium* frame, GC3D
enum format, LayerRendererChromium* layerRenderer) | 173 bool CCVideoLayerImpl::copyFrameToTextures(const VideoFrameChromium* frame, GC3D
enum format, LayerRendererChromium* layerRenderer) |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
332 void CCVideoLayerImpl::dumpLayerProperties(TextStream& ts, int indent) const | 341 void CCVideoLayerImpl::dumpLayerProperties(TextStream& ts, int indent) const |
333 { | 342 { |
334 writeIndent(ts, indent); | 343 writeIndent(ts, indent); |
335 ts << "video layer\n"; | 344 ts << "video layer\n"; |
336 CCLayerImpl::dumpLayerProperties(ts, indent); | 345 CCLayerImpl::dumpLayerProperties(ts, indent); |
337 } | 346 } |
338 | 347 |
339 } | 348 } |
340 | 349 |
341 #endif // USE(ACCELERATED_COMPOSITING) | 350 #endif // USE(ACCELERATED_COMPOSITING) |
OLD | NEW |