| 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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 gl->DeleteTextures(3, source_textures); | 129 gl->DeleteTextures(3, source_textures); |
| 130 return skia::AdoptRef(img); | 130 return skia::AdoptRef(img); |
| 131 } | 131 } |
| 132 | 132 |
| 133 // Creates a SkImage from a |video_frame| backed by native resources. | 133 // Creates a SkImage from a |video_frame| backed by native resources. |
| 134 // The SkImage will take ownership of the underlying resource. | 134 // The SkImage will take ownership of the underlying resource. |
| 135 skia::RefPtr<SkImage> NewSkImageFromVideoFrameNative( | 135 skia::RefPtr<SkImage> NewSkImageFromVideoFrameNative( |
| 136 VideoFrame* video_frame, | 136 VideoFrame* video_frame, |
| 137 const Context3D& context_3d) { | 137 const Context3D& context_3d) { |
| 138 DCHECK(PIXEL_FORMAT_ARGB == video_frame->format() || | 138 DCHECK(PIXEL_FORMAT_ARGB == video_frame->format() || |
| 139 PIXEL_FORMAT_NV12 == video_frame->format() || | |
| 140 PIXEL_FORMAT_UYVY == video_frame->format()); | 139 PIXEL_FORMAT_UYVY == video_frame->format()); |
| 141 | 140 |
| 142 const gpu::MailboxHolder& mailbox_holder = video_frame->mailbox_holder(0); | 141 const gpu::MailboxHolder& mailbox_holder = video_frame->mailbox_holder(0); |
| 143 DCHECK(mailbox_holder.texture_target == GL_TEXTURE_2D || | 142 DCHECK(mailbox_holder.texture_target == GL_TEXTURE_2D || |
| 144 mailbox_holder.texture_target == GL_TEXTURE_RECTANGLE_ARB || | 143 mailbox_holder.texture_target == GL_TEXTURE_RECTANGLE_ARB || |
| 145 mailbox_holder.texture_target == GL_TEXTURE_EXTERNAL_OES) | 144 mailbox_holder.texture_target == GL_TEXTURE_EXTERNAL_OES) |
| 146 << mailbox_holder.texture_target; | 145 << mailbox_holder.texture_target; |
| 147 | 146 |
| 148 gpu::gles2::GLES2Interface* gl = context_3d.gl; | 147 gpu::gles2::GLES2Interface* gl = context_3d.gl; |
| 149 unsigned source_texture = 0; | 148 unsigned source_texture = 0; |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 video_frame->UpdateReleaseSyncPoint(&client); | 569 video_frame->UpdateReleaseSyncPoint(&client); |
| 571 } | 570 } |
| 572 | 571 |
| 573 void SkCanvasVideoRenderer::ResetCache() { | 572 void SkCanvasVideoRenderer::ResetCache() { |
| 574 // Clear cached values. | 573 // Clear cached values. |
| 575 last_image_ = nullptr; | 574 last_image_ = nullptr; |
| 576 last_timestamp_ = kNoTimestamp(); | 575 last_timestamp_ = kNoTimestamp(); |
| 577 } | 576 } |
| 578 | 577 |
| 579 } // namespace media | 578 } // namespace media |
| OLD | NEW |