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 "content/common/gpu/client/gl_helper.h" | 5 #include "content/common/gpu/client/gl_helper.h" |
6 | 6 |
7 #include <queue> | 7 #include <queue> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 1127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1138 base::Bind(&nullcallback)); | 1138 base::Bind(&nullcallback)); |
1139 copy_impl_->ReadbackPlane( | 1139 copy_impl_->ReadbackPlane( |
1140 v_.texture_and_framebuffer(), | 1140 v_.texture_and_framebuffer(), |
1141 target, | 1141 target, |
1142 media::VideoFrame::kVPlane, | 1142 media::VideoFrame::kVPlane, |
1143 1, | 1143 1, |
1144 dst_subrect_, | 1144 dst_subrect_, |
1145 swizzle_, | 1145 swizzle_, |
1146 base::Bind(&CallbackKeepingVideoFrameAlive, target, callback)); | 1146 base::Bind(&CallbackKeepingVideoFrameAlive, target, callback)); |
1147 gl_->BindFramebuffer(GL_FRAMEBUFFER, 0); | 1147 gl_->BindFramebuffer(GL_FRAMEBUFFER, 0); |
1148 media::LetterboxYUV(target, dst_subrect_); | 1148 media::LetterboxYUV(target.get(), dst_subrect_); |
1149 } | 1149 } |
1150 | 1150 |
1151 // YUV readback constructors. Initiates the main scaler pipeline and | 1151 // YUV readback constructors. Initiates the main scaler pipeline and |
1152 // one planar scaler for each of the Y, U and V planes. | 1152 // one planar scaler for each of the Y, U and V planes. |
1153 GLHelper::CopyTextureToImpl::ReadbackYUV_MRT::ReadbackYUV_MRT( | 1153 GLHelper::CopyTextureToImpl::ReadbackYUV_MRT::ReadbackYUV_MRT( |
1154 GLES2Interface* gl, | 1154 GLES2Interface* gl, |
1155 CopyTextureToImpl* copy_impl, | 1155 CopyTextureToImpl* copy_impl, |
1156 GLHelperScaling* scaler_impl, | 1156 GLHelperScaling* scaler_impl, |
1157 GLHelper::ScalerQuality quality, | 1157 GLHelper::ScalerQuality quality, |
1158 const gfx::Size& src_size, | 1158 const gfx::Size& src_size, |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1276 base::Bind(&nullcallback)); | 1276 base::Bind(&nullcallback)); |
1277 copy_impl_->ReadbackPlane( | 1277 copy_impl_->ReadbackPlane( |
1278 &v_, | 1278 &v_, |
1279 target, | 1279 target, |
1280 media::VideoFrame::kVPlane, | 1280 media::VideoFrame::kVPlane, |
1281 1, | 1281 1, |
1282 dst_subrect_, | 1282 dst_subrect_, |
1283 swizzle_, | 1283 swizzle_, |
1284 base::Bind(&CallbackKeepingVideoFrameAlive, target, callback)); | 1284 base::Bind(&CallbackKeepingVideoFrameAlive, target, callback)); |
1285 gl_->BindFramebuffer(GL_FRAMEBUFFER, 0); | 1285 gl_->BindFramebuffer(GL_FRAMEBUFFER, 0); |
1286 media::LetterboxYUV(target, dst_subrect_); | 1286 media::LetterboxYUV(target.get(), dst_subrect_); |
1287 } | 1287 } |
1288 | 1288 |
1289 bool GLHelper::IsReadbackConfigSupported(SkColorType color_type) { | 1289 bool GLHelper::IsReadbackConfigSupported(SkColorType color_type) { |
1290 DCHECK(readback_support_.get()); | 1290 DCHECK(readback_support_.get()); |
1291 GLenum format, type; | 1291 GLenum format, type; |
1292 size_t bytes_per_pixel; | 1292 size_t bytes_per_pixel; |
1293 FormatSupport support = readback_support_->GetReadbackConfig( | 1293 FormatSupport support = readback_support_->GetReadbackConfig( |
1294 color_type, false, &format, &type, &bytes_per_pixel); | 1294 color_type, false, &format, &type, &bytes_per_pixel); |
1295 | 1295 |
1296 return (support == GLHelperReadbackSupport::SUPPORTED); | 1296 return (support == GLHelperReadbackSupport::SUPPORTED); |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1354 return copy_texture_to_impl_->CreateReadbackPipelineYUV(quality, | 1354 return copy_texture_to_impl_->CreateReadbackPipelineYUV(quality, |
1355 src_size, | 1355 src_size, |
1356 src_subrect, | 1356 src_subrect, |
1357 dst_size, | 1357 dst_size, |
1358 dst_subrect, | 1358 dst_subrect, |
1359 flip_vertically, | 1359 flip_vertically, |
1360 use_mrt); | 1360 use_mrt); |
1361 } | 1361 } |
1362 | 1362 |
1363 } // namespace content | 1363 } // namespace content |
OLD | NEW |