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/webmediaplayer_impl.h" | 5 #include "content/renderer/media/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 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 // TODO(scherkus): Clarify paint() API contract to better understand when and | 541 // TODO(scherkus): Clarify paint() API contract to better understand when and |
542 // why it's being called. For example, today paint() is called when: | 542 // why it's being called. For example, today paint() is called when: |
543 // - We haven't reached HAVE_CURRENT_DATA and need to paint black | 543 // - We haven't reached HAVE_CURRENT_DATA and need to paint black |
544 // - We're painting to a canvas | 544 // - We're painting to a canvas |
545 // See http://crbug.com/341225 http://crbug.com/342621 for details. | 545 // See http://crbug.com/341225 http://crbug.com/342621 for details. |
546 scoped_refptr<media::VideoFrame> video_frame = | 546 scoped_refptr<media::VideoFrame> video_frame = |
547 GetCurrentFrameFromCompositor(); | 547 GetCurrentFrameFromCompositor(); |
548 | 548 |
549 gfx::Rect gfx_rect(rect); | 549 gfx::Rect gfx_rect(rect); |
550 | 550 |
551 if (pipeline_metadata_.video_rotation == media::VIDEO_ROTATION_90 || | 551 skcanvas_video_renderer_.Paint(video_frame.get(), |
552 pipeline_metadata_.video_rotation == media::VIDEO_ROTATION_270) { | 552 canvas, |
553 gfx_rect.set_size(gfx::Size(gfx_rect.size().height(), | 553 gfx_rect, |
554 gfx_rect.size().width())); | 554 alpha, |
555 } | 555 pipeline_metadata_.video_rotation); |
556 | |
557 skcanvas_video_renderer_.Paint(video_frame.get(), canvas, gfx_rect, alpha); | |
558 } | 556 } |
559 | 557 |
560 bool WebMediaPlayerImpl::hasSingleSecurityOrigin() const { | 558 bool WebMediaPlayerImpl::hasSingleSecurityOrigin() const { |
561 if (data_source_) | 559 if (data_source_) |
562 return data_source_->HasSingleOrigin(); | 560 return data_source_->HasSingleOrigin(); |
563 return true; | 561 return true; |
564 } | 562 } |
565 | 563 |
566 bool WebMediaPlayerImpl::didPassCORSAccessCheck() const { | 564 bool WebMediaPlayerImpl::didPassCORSAccessCheck() const { |
567 if (data_source_) | 565 if (data_source_) |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1340 compositor_task_runner_->PostTask(FROM_HERE, | 1338 compositor_task_runner_->PostTask(FROM_HERE, |
1341 base::Bind(&GetCurrentFrameAndSignal, | 1339 base::Bind(&GetCurrentFrameAndSignal, |
1342 base::Unretained(compositor_), | 1340 base::Unretained(compositor_), |
1343 &video_frame, | 1341 &video_frame, |
1344 &event)); | 1342 &event)); |
1345 event.Wait(); | 1343 event.Wait(); |
1346 return video_frame; | 1344 return video_frame; |
1347 } | 1345 } |
1348 | 1346 |
1349 } // namespace content | 1347 } // namespace content |
OLD | NEW |