OLD | NEW |
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 "InbandTextTrackPrivateImpl.h" | 8 #include "InbandTextTrackPrivateImpl.h" |
9 #include "WebAudioSourceProvider.h" | 9 #include "WebAudioSourceProvider.h" |
10 #include "WebDocument.h" | 10 #include "WebDocument.h" |
(...skipping 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 if (!m_texture.get()) | 790 if (!m_texture.get()) |
791 return; | 791 return; |
792 m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, videoWidth, videoHeight)
; | 792 m_bitmap.setConfig(SkBitmap::kARGB_8888_Config, videoWidth, videoHeight)
; |
793 m_bitmap.setPixelRef(new SkGrPixelRef(m_texture))->unref(); | 793 m_bitmap.setPixelRef(new SkGrPixelRef(m_texture))->unref(); |
794 } | 794 } |
795 | 795 |
796 // Copy video texture to bitmap texture. | 796 // Copy video texture to bitmap texture. |
797 WebGraphicsContext3D* webGraphicsContext3D = GraphicsContext3DPrivate::extra
ctWebGraphicsContext3D(context3D); | 797 WebGraphicsContext3D* webGraphicsContext3D = GraphicsContext3DPrivate::extra
ctWebGraphicsContext3D(context3D); |
798 WebCanvas* canvas = context->canvas(); | 798 WebCanvas* canvas = context->canvas(); |
799 unsigned int textureId = static_cast<unsigned int>(m_texture->getTextureHand
le()); | 799 unsigned int textureId = static_cast<unsigned int>(m_texture->getTextureHand
le()); |
800 if (!m_webMediaPlayer->copyVideoTextureToPlatformTexture(webGraphicsContext3
D, textureId, 0, GraphicsContext3D::RGBA, true, false)) { return; } | 800 if (!m_webMediaPlayer->copyVideoTextureToPlatformTexture(webGraphicsContext3
D, textureId, 0, GraphicsContext3D::RGBA, GraphicsContext3D::UNSIGNED_BYTE, true
, false)) |
| 801 return; |
801 | 802 |
802 // Draw the texture based bitmap onto the Canvas. If the canvas is hardware
based, this will do a GPU-GPU texture copy. If the canvas is software based, | 803 // Draw the texture based bitmap onto the Canvas. If the canvas is hardware
based, this will do a GPU-GPU texture copy. If the canvas is software based, |
803 // the texture based bitmap will be readbacked to system memory then draw on
to the canvas. | 804 // the texture based bitmap will be readbacked to system memory then draw on
to the canvas. |
804 SkRect dest; | 805 SkRect dest; |
805 dest.set(rect.x(), rect.y(), rect.x() + rect.width(), rect.y() + rect.height
()); | 806 dest.set(rect.x(), rect.y(), rect.x() + rect.width(), rect.y() + rect.height
()); |
806 SkPaint paint; | 807 SkPaint paint; |
807 paint.setAlpha(alpha); | 808 paint.setAlpha(alpha); |
808 // It is not necessary to pass the dest into the drawBitmap call since all t
he context have been set up before calling paintCurrentFrameInContext. | 809 // It is not necessary to pass the dest into the drawBitmap call since all t
he context have been set up before calling paintCurrentFrameInContext. |
809 canvas->drawBitmapRect(m_bitmap, NULL, dest, &paint); | 810 canvas->drawBitmapRect(m_bitmap, NULL, dest, &paint); |
810 } | 811 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
871 | 872 |
872 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel
s, float sampleRate) | 873 void WebMediaPlayerClientImpl::AudioClientImpl::setFormat(size_t numberOfChannel
s, float sampleRate) |
873 { | 874 { |
874 if (m_client) | 875 if (m_client) |
875 m_client->setFormat(numberOfChannels, sampleRate); | 876 m_client->setFormat(numberOfChannels, sampleRate); |
876 } | 877 } |
877 | 878 |
878 #endif | 879 #endif |
879 | 880 |
880 } // namespace WebKit | 881 } // namespace WebKit |
OLD | NEW |