Changeset 106992 in webkit
- Timestamp:
- Feb 7, 2012 2:20:25 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106988 r106992 1 2012-02-07 James Robinson <jamesr@chromium.org> 2 3 [chromium] Allow retaining texture across frames in composited video playback and correctly handle lost context 4 https://bugs.webkit.org/show_bug.cgi?id=77923 5 6 Reviewed by Kenneth Russell. 7 8 Thanks to r106840, we can improve the video playback mode a bit. Instead of creating a new texture on every 9 frame, this attempts to reuse the texture from the previous frame unless the context is lost. Also improves 10 error checking in case the TextureManager cannot successfully reserve memory for the texture. 11 12 Tested manually by killing the GPU process with an html5 video playing and verifying that the video playback 13 continues and that we don't create a new set of textures for each plane on each frame. 14 15 * platform/graphics/chromium/cc/CCVideoLayerImpl.cpp: 16 (WebCore::CCVideoLayerImpl::draw): 17 (WebCore::CCVideoLayerImpl::reserveTextures): 18 1 19 2012-02-07 Matthew Delaney <mdelaney@apple.com> 2 20 -
trunk/Source/WebCore/platform/graphics/chromium/cc/CCVideoLayerImpl.cpp
r106610 r106992 151 151 } 152 152 153 for (unsigned plane = 0; plane < frame->planes(); ++plane) {153 for (unsigned plane = 0; plane < frame->planes(); ++plane) 154 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->renderSurfaceTextureManager().157 // Since there is no guarantee layerRenderer will still be alive the158 // next time we are called, we clear the texture reference. It would159 // be nice if instead we could rely on textures being invalidated when160 // their manager was deleted so that new textures didn't always have to161 // be recreated for each frame.162 m_textures[plane].m_texture.clear();163 }164 155 m_provider->putCurrentFrame(frame); 165 156 } … … 256 247 return false; 257 248 m_textures[plane].m_visibleSize = IntSize(); 249 } else { 250 // The renderSurfaceTextureManager may have been destroyed and recreated since the last frame, so pass the new one. 251 // This is a no-op if the TextureManager is still around. 252 m_textures[plane].m_texture->setTextureManager(layerRenderer->renderSurfaceTextureManager()); 258 253 } 259 254 if (m_textures[plane].m_texture->size() != requiredTextureSize) 260 255 m_textures[plane].m_visibleSize = computeVisibleSize(frame, plane); 261 m_textures[plane].m_texture->reserve(requiredTextureSize, format); 256 if (!m_textures[plane].m_texture->reserve(requiredTextureSize, format)) 257 return false; 262 258 } 263 259 return true;
Note: See TracChangeset
for help on using the changeset viewer.