Changeset 63723 in webkit
- Timestamp:
- Jul 19, 2010 11:28:51 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r63721 r63723 1 2010-07-19 Victoria Kirst <vrk@google.com> 2 3 Reviewed by David Levin. 4 5 Added a simple implementation of VideoLayerChromium. Uses the 6 LayerChromium::updateTextureRect() to send video frames to the 7 GPU. 8 https://bugs.webkit.org/show_bug.cgi?id=42234 9 10 * WebCore.gypi: Added include for VideoLayerChromium. 11 * platform/graphics/chromium/GraphicsLayerChromium.cpp: 12 (WebCore::GraphicsLayerChromium::setContentsToMedia): Implemented 13 setContentsToMedia, though it does not seem to trigger a repaint 14 correctly. 15 * platform/graphics/chromium/GraphicsLayerChromium.h: 16 * platform/graphics/chromium/VideoLayerChromium.cpp: Added. 17 (WebCore::VideoLayerChromium::create): 18 (WebCore::VideoLayerChromium::VideoLayerChromium): 19 (WebCore::VideoLayerChromium::updateTextureContents): 20 * platform/graphics/chromium/VideoLayerChromium.h: Added. 21 (WebCore::VideoLayerChromium::drawsContent): 22 1 23 2010-07-19 Dirk Schulze <krit@webkit.org> 2 24 -
trunk/WebCore/WebCore.gypi
r63721 r63723 2211 2211 'platform/graphics/chromium/UniscribeHelperTextRun.cpp', 2212 2212 'platform/graphics/chromium/UniscribeHelperTextRun.h', 2213 'platform/graphics/chromium/VideoLayerChromium.cpp', 2214 'platform/graphics/chromium/VideoLayerChromium.h', 2213 2215 'platform/graphics/chromium/WebGLLayerChromium.cpp', 2214 2216 'platform/graphics/chromium/WebGLLayerChromium.h', -
trunk/WebCore/platform/graphics/chromium/GraphicsLayerChromium.cpp
r62130 r63723 364 364 #endif 365 365 366 void GraphicsLayerChromium::setContentsToVideo(PlatformLayer* videoLayer) 367 { 368 // FIXME: Implement 366 void GraphicsLayerChromium::setContentsToMedia(PlatformLayer* layer) 367 { 368 bool childrenChanged = false; 369 if (layer) { 370 if (!m_contentsLayer.get() || m_contentsLayerPurpose != ContentsLayerForVideo) { 371 setupContentsLayer(layer); 372 m_contentsLayer = layer; 373 m_contentsLayerPurpose = ContentsLayerForVideo; 374 childrenChanged = true; 375 } 376 layer->setOwner(this); 377 layer->setNeedsDisplay(); 378 updateContentsRect(); 379 } else { 380 if (m_contentsLayer) { 381 childrenChanged = true; 382 383 // The old contents layer will be removed via updateSublayerList. 384 m_contentsLayer = 0; 385 } 386 } 387 388 if (childrenChanged) 389 updateSublayerList(); 369 390 } 370 391 -
trunk/WebCore/platform/graphics/chromium/GraphicsLayerChromium.h
r62130 r63723 86 86 87 87 virtual void setContentsToImage(Image*); 88 virtual void setContentsTo Video(PlatformLayer*);88 virtual void setContentsToMedia(PlatformLayer*); 89 89 virtual void setContentsToWebGL(PlatformLayer*); 90 90 -
trunk/WebKit/chromium/ChangeLog
r63705 r63723 1 2010-07-19 Victoria Kirst <vrk@google.com> 2 3 Reviewed by David Levin. 4 5 Updated WebMediaPlayer to support accelerated rendering and to 6 create and return a VideoChromiumLayer as its platform layer. 7 https://bugs.webkit.org/show_bug.cgi?id=42234 8 9 * src/WebMediaPlayerClientImpl.cpp: 10 (WebKit::WebMediaPlayerClientImpl::platformLayer): 11 (WebKit::WebMediaPlayerClientImpl::create): 12 * src/WebMediaPlayerClientImpl.h: 13 (WebKit::WebMediaPlayerClientImpl::supportsAcceleratedRendering): 14 1 15 2010-07-19 Kenneth Russell <kbr@google.com> 2 16 -
trunk/WebKit/chromium/src/WebMediaPlayerClientImpl.cpp
r59466 r63723 15 15 #include "MediaPlayer.h" 16 16 #include "NotImplemented.h" 17 #include "RenderView.h" 17 18 #include "TimeRanges.h" 19 #include "VideoLayerChromium.h" 20 21 #if USE(ACCELERATED_COMPOSITING) 22 #include "RenderLayerCompositor.h" 23 #endif 18 24 19 25 #include "WebCanvas.h" … … 29 35 #include "WebString.h" 30 36 #include "WebURL.h" 37 #include "WebViewImpl.h" 31 38 32 39 // WebCommon.h defines WEBKIT_USING_SKIA so this has to be included last. … … 46 53 { 47 54 WebFrameImpl* webFrame = WebFrameImpl::fromFrame(frame); 55 48 56 if (!webFrame->client()) 49 57 return 0; … … 147 155 Frame* frame = static_cast<HTMLMediaElement*>( 148 156 m_mediaPlayer->mediaPlayerClient())->document()->frame(); 157 149 158 m_webMediaPlayer.set(createWebMediaPlayer(this, frame)); 150 159 if (m_webMediaPlayer.get()) … … 157 166 m_webMediaPlayer->cancelLoad(); 158 167 } 168 169 #if USE(ACCELERATED_COMPOSITING) 170 WebCore::PlatformLayer* WebMediaPlayerClientImpl::platformLayer() const 171 { 172 ASSERT(m_supportsAcceleratedCompositing); 173 return m_videoLayer.get(); 174 } 175 #endif 159 176 160 177 void WebMediaPlayerClientImpl::play() … … 361 378 } 362 379 380 #if USE(ACCELERATED_COMPOSITING) 381 bool WebMediaPlayerClientImpl::supportsAcceleratedRendering() const 382 { 383 return m_supportsAcceleratedCompositing; 384 } 385 #endif 386 363 387 MediaPlayer::MovieLoadType WebMediaPlayerClientImpl::movieLoadType() const 364 388 { … … 373 397 WebMediaPlayerClientImpl* client = new WebMediaPlayerClientImpl(); 374 398 client->m_mediaPlayer = player; 399 400 #if USE(ACCELERATED_COMPOSITING) 401 Frame* frame = static_cast<HTMLMediaElement*>( 402 client->m_mediaPlayer->mediaPlayerClient())->document()->frame(); 403 404 // This does not actually check whether the hardware can support accelerated 405 // compositing, but only if the flag is set. However, this is checked lazily 406 // in WebViewImpl::setIsAcceleratedCompositingActive() and will fail there 407 // if necessary. 408 client->m_supportsAcceleratedCompositing = 409 frame->contentRenderer()->compositor()->hasAcceleratedCompositing(); 410 411 if (client->m_supportsAcceleratedCompositing) 412 client->m_videoLayer = VideoLayerChromium::create(0); 413 #endif 414 375 415 return client; 376 416 } … … 403 443 WebMediaPlayerClientImpl::WebMediaPlayerClientImpl() 404 444 : m_mediaPlayer(0) 445 #if USE(ACCELERATED_COMPOSITING) 446 , m_videoLayer(0) 447 , m_supportsAcceleratedCompositing(false) 448 #endif 405 449 { 406 450 } -
trunk/WebKit/chromium/src/WebMediaPlayerClientImpl.h
r59466 r63723 67 67 virtual void load(const WebCore::String& url); 68 68 virtual void cancelLoad(); 69 #if USE(ACCELERATED_COMPOSITING) 70 virtual WebCore::PlatformLayer* platformLayer() const; 71 #endif 69 72 virtual void play(); 70 73 virtual void pause(); … … 95 98 virtual void paint(WebCore::GraphicsContext*, const WebCore::IntRect&); 96 99 virtual bool hasSingleSecurityOrigin() const; 100 #if USE(ACCELERATED_COMPOSITING) 101 virtual bool supportsAcceleratedRendering() const; 102 #endif 103 97 104 virtual WebCore::MediaPlayer::MovieLoadType movieLoadType() const; 98 105 … … 107 114 WebCore::MediaPlayer* m_mediaPlayer; 108 115 OwnPtr<WebMediaPlayer> m_webMediaPlayer; 116 #if USE(ACCELERATED_COMPOSITING) 117 RefPtr<WebCore::PlatformLayer> m_videoLayer; 118 bool m_supportsAcceleratedCompositing; 119 #endif 109 120 static bool m_isEnabled; 110 121 };
Note: See TracChangeset
for help on using the changeset viewer.