Changeset 95957 in webkit
- Timestamp:
- Sep 26, 2011 9:44:18 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 3 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r95956 r95957 1 2011-09-23 Adrienne Walker <enne@google.com> 2 3 [chromium] Update VideoLayerChromium textures after texture resources are reclaimed 4 https://bugs.webkit.org/show_bug.cgi?id=68742 5 6 Reviewed by James Robinson. 7 8 Without this patch, this video texture is invalid. 9 10 * compositing/video-page-visibility-expected.png: Added. 11 * compositing/video-page-visibility-expected.txt: Added. 12 * compositing/video-page-visibility.html: Added. 13 1 14 2011-09-26 Ilya Tikhonovsky <loislo@chromium.org> 2 15 -
trunk/Source/WebCore/ChangeLog
r95953 r95957 1 2011-09-23 Adrienne Walker <enne@google.com> 2 3 [chromium] Update VideoLayerChromium textures after texture resources are reclaimed 4 https://bugs.webkit.org/show_bug.cgi?id=68742 5 6 Reviewed by James Robinson. 7 8 If video textures are reclaimed (such as during a visibility change on 9 a tab), the dirty rect for the layer is empty and it skips out of 10 updating compositor resources, leaving the video textures invalid. 11 Instead, check the textures here to make sure they're still valid 12 first before early out so that they can get reupdated if necessary. 13 14 Additionally, fix a small bug in pushPropertiesTo where 1 plane RGB 15 videos would not get drawn because all 3 planes didn't have valid 16 textures. 17 18 Test: compositing/video-page-visibility.html 19 20 * platform/graphics/chromium/VideoLayerChromium.cpp: 21 (WebCore::VideoLayerChromium::VideoLayerChromium): 22 (WebCore::VideoLayerChromium::cleanupResources): 23 (WebCore::VideoLayerChromium::updateCompositorResources): 24 (WebCore::VideoLayerChromium::pushPropertiesTo): 25 (WebCore::VideoLayerChromium::setLayerTreeHost): 26 (WebCore::VideoLayerChromium::texturesValid): 27 * platform/graphics/chromium/VideoLayerChromium.h: 28 1 29 2011-09-26 Pavel Feldman <pfeldman@google.com> 2 30 -
trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.cpp
r95901 r95957 56 56 , m_frameFormat(VideoFrameChromium::Invalid) 57 57 , m_provider(provider) 58 , m_planes(0) 58 59 , m_currentFrame(0) 59 60 { … … 73 74 { 74 75 LayerChromium::cleanupResources(); 75 for ( size_t i = 0; i < 3; ++i)76 for (unsigned i = 0; i < MaxPlanes; ++i) 76 77 m_textures[i].m_texture.clear(); 77 78 releaseCurrentFrame(); … … 80 81 void VideoLayerChromium::updateCompositorResources(GraphicsContext3D* context) 81 82 { 82 if (m_dirtyRect.isEmpty() || !m_delegate) 83 return; 83 if (!m_delegate) 84 return; 85 86 if (m_dirtyRect.isEmpty() && texturesValid()) { 87 for (unsigned plane = 0; plane < m_planes; plane++) { 88 ManagedTexture* tex = m_textures[plane].m_texture.get(); 89 if (!tex->reserve(tex->size(), tex->format())) { 90 m_skipsDraw = true; 91 break; 92 } 93 } 94 return; 95 } 84 96 85 97 ASSERT(drawsContent()); 86 98 99 m_planes = 0; 87 100 m_skipsDraw = false; 101 88 102 VideoFrameChromium* frame = m_provider->getCurrentFrame(); 89 103 if (!frame) { … … 120 134 } 121 135 136 m_planes = frame->planes(); 137 ASSERT(m_planes <= MaxPlanes); 138 122 139 resetNeedsDisplay(); 123 140 … … 132 149 videoLayer->setSkipsDraw(m_skipsDraw); 133 150 videoLayer->setFrameFormat(m_frameFormat); 134 for ( size_t i = 0; i < 3; ++i) {151 for (unsigned i = 0; i < m_planes; ++i) { 135 152 if (!m_textures[i].m_texture) { 136 153 videoLayer->setSkipsDraw(true); … … 139 156 videoLayer->setTexture(i, m_textures[i].m_texture->textureId(), m_textures[i].m_texture->size(), m_textures[i].m_visibleSize); 140 157 } 158 for (unsigned i = m_planes; i < MaxPlanes; ++i) 159 videoLayer->setTexture(i, 0, IntSize(), IntSize()); 141 160 } 142 161 … … 144 163 { 145 164 if (host && layerTreeHost() != host) { 146 for ( size_t i = 0; i < 3; ++i) {165 for (unsigned i = 0; i < MaxPlanes; ++i) { 147 166 m_textures[i].m_visibleSize = IntSize(); 148 167 m_textures[i].m_texture = ManagedTexture::create(host->contentsTextureManager()); … … 165 184 } 166 185 return GraphicsContext3D::INVALID_VALUE; 186 } 187 188 bool VideoLayerChromium::texturesValid() 189 { 190 for (unsigned plane = 0; plane < m_planes; plane++) { 191 ManagedTexture* tex = m_textures[plane].m_texture.get(); 192 if (!tex->isValid(tex->size(), tex->format())) 193 return false; 194 } 195 return true; 167 196 } 168 197 -
trunk/Source/WebCore/platform/graphics/chromium/VideoLayerChromium.h
r95901 r95957 75 75 static GC3Denum determineTextureFormat(const VideoFrameChromium*); 76 76 static IntSize computeVisibleSize(const VideoFrameChromium*, unsigned plane); 77 bool texturesValid(); 77 78 bool reserveTextures(const VideoFrameChromium*, GC3Denum textureFormat); 78 79 void updateTexture(GraphicsContext3D*, Texture&, const void*) const; … … 84 85 VideoFrameProvider* m_provider; 85 86 86 Texture m_textures[3]; 87 enum { MaxPlanes = 3 }; 88 Texture m_textures[MaxPlanes]; 89 unsigned m_planes; 87 90 88 91 // This will be null for the entire duration of video playback if hardware
Note: See TracChangeset
for help on using the changeset viewer.