OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/skcanvas_video_renderer.h" | 5 #include "media/blink/skcanvas_video_renderer.h" |
6 | 6 |
7 #include "gpu/GLES2/gl2extchromium.h" | 7 #include "gpu/GLES2/gl2extchromium.h" |
8 #include "gpu/command_buffer/client/gles2_interface.h" | 8 #include "gpu/command_buffer/client/gles2_interface.h" |
9 #include "gpu/command_buffer/common/mailbox_holder.h" | 9 #include "gpu/command_buffer/common/mailbox_holder.h" |
10 #include "media/base/video_frame.h" | 10 #include "media/base/video_frame.h" |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
393 video_frame, last_frame_.getPixels(), last_frame_.rowBytes()); | 393 video_frame, last_frame_.getPixels(), last_frame_.rowBytes()); |
394 last_frame_.notifyPixelsChanged(); | 394 last_frame_.notifyPixelsChanged(); |
395 last_frame_.unlockPixels(); | 395 last_frame_.unlockPixels(); |
396 last_frame_timestamp_ = video_frame->timestamp(); | 396 last_frame_timestamp_ = video_frame->timestamp(); |
397 } | 397 } |
398 target_frame = &last_frame_; | 398 target_frame = &last_frame_; |
399 frame_deleting_timer_.Reset(); | 399 frame_deleting_timer_.Reset(); |
400 } | 400 } |
401 | 401 |
402 paint.setXfermodeMode(mode); | 402 paint.setXfermodeMode(mode); |
403 paint.setFilterLevel(SkPaint::kLow_FilterLevel); | 403 paint.setFilterQuality(kLow_SkFilterQuality); |
404 | 404 |
405 bool need_transform = | 405 bool need_transform = |
406 video_rotation != VIDEO_ROTATION_0 || | 406 video_rotation != VIDEO_ROTATION_0 || |
407 dest_rect.size() != video_frame->visible_rect().size() || | 407 dest_rect.size() != video_frame->visible_rect().size() || |
408 !dest_rect.origin().IsOrigin(); | 408 !dest_rect.origin().IsOrigin(); |
409 if (need_transform) { | 409 if (need_transform) { |
410 canvas->save(); | 410 canvas->save(); |
411 canvas->translate( | 411 canvas->translate( |
412 SkFloatToScalar(dest_rect.x() + (dest_rect.width() * 0.5f)), | 412 SkFloatToScalar(dest_rect.x() + (dest_rect.width() * 0.5f)), |
413 SkFloatToScalar(dest_rect.y() + (dest_rect.height() * 0.5f))); | 413 SkFloatToScalar(dest_rect.y() + (dest_rect.height() * 0.5f))); |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 last_frame_timestamp_ = media::kNoTimestamp(); | 641 last_frame_timestamp_ = media::kNoTimestamp(); |
642 } | 642 } |
643 | 643 |
644 void SkCanvasVideoRenderer::ResetAcceleratedLastFrame() { | 644 void SkCanvasVideoRenderer::ResetAcceleratedLastFrame() { |
645 accelerated_last_frame_.reset(); | 645 accelerated_last_frame_.reset(); |
646 accelerated_generator_ = nullptr; | 646 accelerated_generator_ = nullptr; |
647 accelerated_last_frame_timestamp_ = media::kNoTimestamp(); | 647 accelerated_last_frame_timestamp_ = media::kNoTimestamp(); |
648 } | 648 } |
649 | 649 |
650 } // namespace media | 650 } // namespace media |
OLD | NEW |