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 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
569 return false; | 569 return false; |
570 bitmap.setInfo(info); | 570 bitmap.setInfo(info); |
571 bitmap.setPixelRef(pixelRef)->unref(); | 571 bitmap.setPixelRef(pixelRef)->unref(); |
572 } | 572 } |
573 | 573 |
574 return true; | 574 return true; |
575 } | 575 } |
576 | 576 |
577 void WebMediaPlayerAndroid::paint(blink::WebCanvas* canvas, | 577 void WebMediaPlayerAndroid::paint(blink::WebCanvas* canvas, |
578 const blink::WebRect& rect, | 578 const blink::WebRect& rect, |
579 unsigned char alpha) { | |
580 paint(canvas, rect, alpha, SkXfermode::kSrcOver_Mode); | |
581 } | |
582 | |
583 void WebMediaPlayerAndroid::paint(blink::WebCanvas* canvas, | |
584 const blink::WebRect& rect, | |
585 unsigned char alpha, | 579 unsigned char alpha, |
586 SkXfermode::Mode mode) { | 580 SkXfermode::Mode mode) { |
587 DCHECK(main_thread_checker_.CalledOnValidThread()); | 581 DCHECK(main_thread_checker_.CalledOnValidThread()); |
588 scoped_ptr<blink::WebGraphicsContext3DProvider> provider = | 582 scoped_ptr<blink::WebGraphicsContext3DProvider> provider = |
589 scoped_ptr<blink::WebGraphicsContext3DProvider>(blink::Platform::current( | 583 scoped_ptr<blink::WebGraphicsContext3DProvider>(blink::Platform::current( |
590 )->createSharedOffscreenGraphicsContext3DProvider()); | 584 )->createSharedOffscreenGraphicsContext3DProvider()); |
591 if (!provider) | 585 if (!provider) |
592 return; | 586 return; |
593 blink::WebGraphicsContext3D* context3D = provider->context3d(); | 587 blink::WebGraphicsContext3D* context3D = provider->context3d(); |
594 if (!context3D) | 588 if (!context3D) |
(...skipping 1235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1830 | 1824 |
1831 bool WebMediaPlayerAndroid::IsHLSStream() const { | 1825 bool WebMediaPlayerAndroid::IsHLSStream() const { |
1832 std::string mime; | 1826 std::string mime; |
1833 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; | 1827 GURL url = redirected_url_.is_empty() ? url_ : redirected_url_; |
1834 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) | 1828 if (!net::GetMimeTypeFromFile(base::FilePath(url.path()), &mime)) |
1835 return false; | 1829 return false; |
1836 return !mime.compare("application/x-mpegurl"); | 1830 return !mime.compare("application/x-mpegurl"); |
1837 } | 1831 } |
1838 | 1832 |
1839 } // namespace content | 1833 } // namespace content |
OLD | NEW |