Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(68)

Side by Side Diff: Source/web/WebMediaPlayerClientImpl.cpp

Issue 127163003: Completely removed the Extensions3D class (Take 2) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/platform/graphics/gpu/SharedGraphicsContext3D.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 #include "config.h" 5 #include "config.h"
6 #include "WebMediaPlayerClientImpl.h" 6 #include "WebMediaPlayerClientImpl.h"
7 7
8 #include "WebDocument.h" 8 #include "WebDocument.h"
9 #include "WebFrameClient.h" 9 #include "WebFrameClient.h"
10 #include "WebFrameImpl.h" 10 #include "WebFrameImpl.h"
(...skipping 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 #endif 463 #endif
464 WebCanvas* canvas = context->canvas(); 464 WebCanvas* canvas = context->canvas();
465 m_webMediaPlayer->paint(canvas, rect, context->getNormalizedAlpha()); 465 m_webMediaPlayer->paint(canvas, rect, context->getNormalizedAlpha());
466 } 466 }
467 } 467 }
468 468
469 bool WebMediaPlayerClientImpl::copyVideoTextureToPlatformTexture(WebCore::Graphi csContext3D* context, Platform3DObject texture, GLint level, GLenum type, GLenum internalFormat, bool premultiplyAlpha, bool flipY) 469 bool WebMediaPlayerClientImpl::copyVideoTextureToPlatformTexture(WebCore::Graphi csContext3D* context, Platform3DObject texture, GLint level, GLenum type, GLenum internalFormat, bool premultiplyAlpha, bool flipY)
470 { 470 {
471 if (!context || !m_webMediaPlayer) 471 if (!context || !m_webMediaPlayer)
472 return false; 472 return false;
473 Extensions3D* extensions = context->extensions(); 473 if (!context->supportsExtension("GL_CHROMIUM_copy_texture") || !context->sup portsExtension("GL_CHROMIUM_flipy")
474 if (!extensions || !extensions->supports("GL_CHROMIUM_copy_texture") || !ext ensions->supports("GL_CHROMIUM_flipy") 474 || !context->canUseCopyTextureCHROMIUM(internalFormat, type, level) || ! context->makeContextCurrent())
475 || !extensions->canUseCopyTextureCHROMIUM(internalFormat, type, level) | | !context->makeContextCurrent())
476 return false; 475 return false;
477 WebGraphicsContext3D* webGraphicsContext3D = context->webContext(); 476 WebGraphicsContext3D* webGraphicsContext3D = context->webContext();
478 return m_webMediaPlayer->copyVideoTextureToPlatformTexture(webGraphicsContex t3D, texture, level, internalFormat, type, premultiplyAlpha, flipY); 477 return m_webMediaPlayer->copyVideoTextureToPlatformTexture(webGraphicsContex t3D, texture, level, internalFormat, type, premultiplyAlpha, flipY);
479 } 478 }
480 479
481 void WebMediaPlayerClientImpl::setPreload(MediaPlayer::Preload preload) 480 void WebMediaPlayerClientImpl::setPreload(MediaPlayer::Preload preload)
482 { 481 {
483 m_preload = preload; 482 m_preload = preload;
484 483
485 if (m_webMediaPlayer) 484 if (m_webMediaPlayer)
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 { 560 {
562 return adoptPtr(new WebMediaPlayerClientImpl(client)); 561 return adoptPtr(new WebMediaPlayerClientImpl(client));
563 } 562 }
564 563
565 #if OS(ANDROID) 564 #if OS(ANDROID)
566 void WebMediaPlayerClientImpl::paintOnAndroid(WebCore::GraphicsContext* context, WebCore::GraphicsContext3D* context3D, const IntRect& rect, uint8_t alpha) 565 void WebMediaPlayerClientImpl::paintOnAndroid(WebCore::GraphicsContext* context, WebCore::GraphicsContext3D* context3D, const IntRect& rect, uint8_t alpha)
567 { 566 {
568 if (!context || !context3D || !m_webMediaPlayer || context->paintingDisabled ()) 567 if (!context || !context3D || !m_webMediaPlayer || context->paintingDisabled ())
569 return; 568 return;
570 569
571 Extensions3D* extensions = context3D->extensions(); 570 if (!context3D->supportsExtension("GL_CHROMIUM_copy_texture") || !context3D- >supportsExtension("GL_CHROMIUM_flipy")
572 if (!extensions || !extensions->supports("GL_CHROMIUM_copy_texture") || !ext ensions->supports("GL_CHROMIUM_flipy")
573 || !context3D->makeContextCurrent()) 571 || !context3D->makeContextCurrent())
574 return; 572 return;
575 573
576 // Copy video texture into a RGBA texture based bitmap first as video textur e on Android is GL_TEXTURE_EXTERNAL_OES 574 // Copy video texture into a RGBA texture based bitmap first as video textur e on Android is GL_TEXTURE_EXTERNAL_OES
577 // which is not supported by Skia yet. The bitmap's size needs to be the sam e as the video and use naturalSize() here. 575 // which is not supported by Skia yet. The bitmap's size needs to be the sam e as the video and use naturalSize() here.
578 // Check if we could reuse existing texture based bitmap. 576 // Check if we could reuse existing texture based bitmap.
579 // Otherwise, release existing texture based bitmap and allocate a new one b ased on video size. 577 // Otherwise, release existing texture based bitmap and allocate a new one b ased on video size.
580 if (!ensureTextureBackedSkBitmap(context3D->grContext(), m_bitmap, naturalSi ze(), kTopLeft_GrSurfaceOrigin, kSkia8888_GrPixelConfig)) 578 if (!ensureTextureBackedSkBitmap(context3D->grContext(), m_bitmap, naturalSi ze(), kTopLeft_GrSurfaceOrigin, kSkia8888_GrPixelConfig))
581 return; 579 return;
582 580
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 670
673 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel s, float sampleRate) 671 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel s, float sampleRate)
674 { 672 {
675 if (m_client) 673 if (m_client)
676 m_client->setFormat(numberOfChannels, sampleRate); 674 m_client->setFormat(numberOfChannels, sampleRate);
677 } 675 }
678 676
679 #endif 677 #endif
680 678
681 } // namespace blink 679 } // namespace blink
OLDNEW
« no previous file with comments | « Source/platform/graphics/gpu/SharedGraphicsContext3D.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698