Chromium Code Reviews| 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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 345 return; | 345 return; |
| 346 last_timestamp_ = video_frame->timestamp(); | 346 last_timestamp_ = video_frame->timestamp(); |
| 347 } | 347 } |
| 348 last_image_deleting_timer_.Reset(); | 348 last_image_deleting_timer_.Reset(); |
| 349 | 349 |
| 350 paint.setXfermodeMode(mode); | 350 paint.setXfermodeMode(mode); |
| 351 paint.setFilterQuality(kLow_SkFilterQuality); | 351 paint.setFilterQuality(kLow_SkFilterQuality); |
| 352 | 352 |
| 353 const bool need_transform = | 353 const bool need_transform = |
| 354 video_rotation != VIDEO_ROTATION_0 || | 354 video_rotation != VIDEO_ROTATION_0 || |
| 355 dest_rect.size() != video_frame->visible_rect().size() || | 355 dest_rect.size() != gfx::SizeF(video_frame->visible_rect().size()) || |
|
no sievers
2015/09/24 00:07:33
hmm, do we really want to compare the rounded inte
danakj
2015/09/24 00:36:05
Ya I'm not sure, but this is what the code does to
DaleCurtis
2015/09/24 01:40:09
It seems like .size() should be dropped from both
danakj
2015/09/24 17:48:35
I'd like to not change behaviour in this patch, bu
| |
| 356 !dest_rect.origin().IsOrigin(); | 356 !dest_rect.origin().IsOrigin(); |
| 357 if (need_transform) { | 357 if (need_transform) { |
| 358 canvas->save(); | 358 canvas->save(); |
| 359 canvas->translate( | 359 canvas->translate( |
| 360 SkFloatToScalar(dest_rect.x() + (dest_rect.width() * 0.5f)), | 360 SkFloatToScalar(dest_rect.x() + (dest_rect.width() * 0.5f)), |
| 361 SkFloatToScalar(dest_rect.y() + (dest_rect.height() * 0.5f))); | 361 SkFloatToScalar(dest_rect.y() + (dest_rect.height() * 0.5f))); |
| 362 SkScalar angle = SkFloatToScalar(0.0f); | 362 SkScalar angle = SkFloatToScalar(0.0f); |
| 363 switch (video_rotation) { | 363 switch (video_rotation) { |
| 364 case VIDEO_ROTATION_0: | 364 case VIDEO_ROTATION_0: |
| 365 break; | 365 break; |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 581 video_frame->UpdateReleaseSyncPoint(&client); | 581 video_frame->UpdateReleaseSyncPoint(&client); |
| 582 } | 582 } |
| 583 | 583 |
| 584 void SkCanvasVideoRenderer::ResetCache() { | 584 void SkCanvasVideoRenderer::ResetCache() { |
| 585 // Clear cached values. | 585 // Clear cached values. |
| 586 last_image_ = nullptr; | 586 last_image_ = nullptr; |
| 587 last_timestamp_ = kNoTimestamp(); | 587 last_timestamp_ = kNoTimestamp(); |
| 588 } | 588 } |
| 589 | 589 |
| 590 } // namespace media | 590 } // namespace media |
| OLD | NEW |