| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "content/renderer/media/android/webmediaplayer_android.h" | 5 #include "content/renderer/media/android/webmediaplayer_android.h" |
| 6 | 6 |
| 7 #include <limits> | 7 #include <limits> |
| 8 | 8 |
| 9 #include "base/android/build_info.h" | 9 #include "base/android/build_info.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 503 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 void WebMediaPlayerAndroid::paint(blink::WebCanvas* canvas, | 514 void WebMediaPlayerAndroid::paint(blink::WebCanvas* canvas, |
| 515 const blink::WebRect& rect, | 515 const blink::WebRect& rect, |
| 516 unsigned char alpha) { | 516 unsigned char alpha) { |
| 517 DCHECK(main_thread_checker_.CalledOnValidThread()); | 517 DCHECK(main_thread_checker_.CalledOnValidThread()); |
| 518 scoped_ptr<blink::WebGraphicsContext3DProvider> provider = | 518 scoped_ptr<blink::WebGraphicsContext3DProvider> provider = |
| 519 scoped_ptr<blink::WebGraphicsContext3DProvider>(blink::Platform::current( | 519 scoped_ptr<blink::WebGraphicsContext3DProvider>(blink::Platform::current( |
| 520 )->createSharedOffscreenGraphicsContext3DProvider()); | 520 )->createSharedOffscreenGraphicsContext3DProvider()); |
| 521 if (!provider) | 521 if (!provider) |
| 522 return; | 522 return; |
| 523 blink::WebGraphicsContext3D* context3D = provider->context3d(); | 523 blink::WebGraphicsContext3D* context3D = provider->context3d(); |
| 524 if (!context3D || !context3D->makeContextCurrent()) | 524 if (!context3D) |
| 525 return; | 525 return; |
| 526 | 526 |
| 527 // Copy video texture into a RGBA texture based bitmap first as video texture | 527 // Copy video texture into a RGBA texture based bitmap first as video texture |
| 528 // on Android is GL_TEXTURE_EXTERNAL_OES which is not supported by Skia yet. | 528 // on Android is GL_TEXTURE_EXTERNAL_OES which is not supported by Skia yet. |
| 529 // The bitmap's size needs to be the same as the video and use naturalSize() | 529 // The bitmap's size needs to be the same as the video and use naturalSize() |
| 530 // here. Check if we could reuse existing texture based bitmap. | 530 // here. Check if we could reuse existing texture based bitmap. |
| 531 // Otherwise, release existing texture based bitmap and allocate | 531 // Otherwise, release existing texture based bitmap and allocate |
| 532 // a new one based on video size. | 532 // a new one based on video size. |
| 533 if (!EnsureTextureBackedSkBitmap(provider->grContext(), bitmap_, | 533 if (!EnsureTextureBackedSkBitmap(provider->grContext(), bitmap_, |
| 534 naturalSize(), kTopLeft_GrSurfaceOrigin, kSkia8888_GrPixelConfig)) { | 534 naturalSize(), kTopLeft_GrSurfaceOrigin, kSkia8888_GrPixelConfig)) { |
| (...skipping 1186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1721 player_manager_->EnterFullscreen(player_id_, frame_); | 1721 player_manager_->EnterFullscreen(player_id_, frame_); |
| 1722 SetNeedsEstablishPeer(false); | 1722 SetNeedsEstablishPeer(false); |
| 1723 } | 1723 } |
| 1724 } | 1724 } |
| 1725 | 1725 |
| 1726 bool WebMediaPlayerAndroid::canEnterFullscreen() const { | 1726 bool WebMediaPlayerAndroid::canEnterFullscreen() const { |
| 1727 return player_manager_->CanEnterFullscreen(frame_); | 1727 return player_manager_->CanEnterFullscreen(frame_); |
| 1728 } | 1728 } |
| 1729 | 1729 |
| 1730 } // namespace content | 1730 } // namespace content |
| OLD | NEW |