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 "media/blink/webmediaplayer_impl.h" | 5 #include "media/blink/webmediaplayer_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 | 502 |
503 bool WebMediaPlayerImpl::didLoadingProgress() { | 503 bool WebMediaPlayerImpl::didLoadingProgress() { |
504 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 504 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
505 bool pipeline_progress = pipeline_.DidLoadingProgress(); | 505 bool pipeline_progress = pipeline_.DidLoadingProgress(); |
506 bool data_progress = buffered_data_source_host_.DidLoadingProgress(); | 506 bool data_progress = buffered_data_source_host_.DidLoadingProgress(); |
507 return pipeline_progress || data_progress; | 507 return pipeline_progress || data_progress; |
508 } | 508 } |
509 | 509 |
510 void WebMediaPlayerImpl::paint(blink::WebCanvas* canvas, | 510 void WebMediaPlayerImpl::paint(blink::WebCanvas* canvas, |
511 const blink::WebRect& rect, | 511 const blink::WebRect& rect, |
512 unsigned char alpha) { | |
513 paint(canvas, rect, alpha, SkXfermode::kSrcOver_Mode); | |
514 } | |
515 | |
516 void WebMediaPlayerImpl::paint(blink::WebCanvas* canvas, | |
517 const blink::WebRect& rect, | |
518 unsigned char alpha, | 512 unsigned char alpha, |
519 SkXfermode::Mode mode) { | 513 SkXfermode::Mode mode) { |
520 DCHECK(main_task_runner_->BelongsToCurrentThread()); | 514 DCHECK(main_task_runner_->BelongsToCurrentThread()); |
521 TRACE_EVENT0("media", "WebMediaPlayerImpl:paint"); | 515 TRACE_EVENT0("media", "WebMediaPlayerImpl:paint"); |
522 | 516 |
523 // TODO(scherkus): Clarify paint() API contract to better understand when and | 517 // TODO(scherkus): Clarify paint() API contract to better understand when and |
524 // why it's being called. For example, today paint() is called when: | 518 // why it's being called. For example, today paint() is called when: |
525 // - We haven't reached HAVE_CURRENT_DATA and need to paint black | 519 // - We haven't reached HAVE_CURRENT_DATA and need to paint black |
526 // - We're painting to a canvas | 520 // - We're painting to a canvas |
527 // See http://crbug.com/341225 http://crbug.com/342621 for details. | 521 // See http://crbug.com/341225 http://crbug.com/342621 for details. |
(...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1021 compositor_task_runner_->PostTask(FROM_HERE, | 1015 compositor_task_runner_->PostTask(FROM_HERE, |
1022 base::Bind(&GetCurrentFrameAndSignal, | 1016 base::Bind(&GetCurrentFrameAndSignal, |
1023 base::Unretained(compositor_), | 1017 base::Unretained(compositor_), |
1024 &video_frame, | 1018 &video_frame, |
1025 &event)); | 1019 &event)); |
1026 event.Wait(); | 1020 event.Wait(); |
1027 return video_frame; | 1021 return video_frame; |
1028 } | 1022 } |
1029 | 1023 |
1030 } // namespace media | 1024 } // namespace media |
OLD | NEW |