Commit ee99af18 authored by Greg Daniel's avatar Greg Daniel Committed by Commit Bot

Move SkImage::getTextureHandle to getBackendTexture in content media capture.

In skia getTextureHandle is deprecated and this change moves to using the
new API.

Change-Id: I44d5b3b45dcee0420f475dd5b93c4f5337bbfb96
Reviewed-on: https://chromium-review.googlesource.com/1024292
Commit-Queue: Greg Daniel <egdaniel@chromium.org>
Reviewed-by: default avatarEmircan Uysaler <emircan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552803}
parent 2b94633e
......@@ -20,12 +20,12 @@
#include "content/renderer/media/webrtc/webrtc_uma_histograms.h"
#include "content/renderer/render_thread_impl.h"
#include "media/base/limits.h"
#include "skia/ext/texture_handle.h"
#include "third_party/blink/public/platform/web_graphics_context_3d_provider.h"
#include "third_party/blink/public/platform/web_media_stream_source.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/libyuv/include/libyuv.h"
#include "third_party/skia/include/core/SkImage.h"
#include "third_party/skia/include/gpu/GrBackendSurface.h"
using media::VideoFrame;
......@@ -280,12 +280,15 @@ void CanvasCaptureHandler::ReadARGBPixelsAsync(
return;
}
GrSurfaceOrigin surface_origin = kTopLeft_GrSurfaceOrigin;
const GrGLTextureInfo* texture_info = skia::GrBackendObjectToGrGLTextureInfo(
image->getTextureHandle(true, &surface_origin));
DCHECK(texture_info);
GrBackendTexture backend_texture =
image->getBackendTexture(true, &surface_origin);
DCHECK(backend_texture.isValid());
GrGLTextureInfo texture_info;
const bool result = backend_texture.getGLTextureInfo(&texture_info);
DCHECK(result);
DCHECK(context_provider->GetGLHelper());
context_provider->GetGLHelper()->ReadbackTextureAsync(
texture_info->fID, image_size,
texture_info.fID, image_size,
temp_argb_frame->visible_data(VideoFrame::kARGBPlane), kN32_SkColorType,
base::Bind(&CanvasCaptureHandler::OnARGBPixelsReadAsync,
weak_ptr_factory_.GetWeakPtr(), image, temp_argb_frame,
......@@ -308,14 +311,17 @@ void CanvasCaptureHandler::ReadYUVPixelsAsync(
}
GrSurfaceOrigin surface_origin = kTopLeft_GrSurfaceOrigin;
const GrGLTextureInfo* texture_info = skia::GrBackendObjectToGrGLTextureInfo(
image->getTextureHandle(true, &surface_origin));
DCHECK(texture_info);
GrBackendTexture backend_texture =
image->getBackendTexture(true, &surface_origin);
DCHECK(backend_texture.isValid());
GrGLTextureInfo texture_info;
const bool result = backend_texture.getGLTextureInfo(&texture_info);
DCHECK(result);
DCHECK(context_provider->GetGLHelper());
const gpu::MailboxHolder& mailbox_holder =
context_provider->GetGLHelper()->ProduceMailboxHolderFromTexture(
texture_info->fID);
DCHECK_EQ(static_cast<int>(texture_info->fTarget), GL_TEXTURE_2D);
texture_info.fID);
DCHECK_EQ(static_cast<int>(texture_info.fTarget), GL_TEXTURE_2D);
viz::ReadbackYUVInterface* const yuv_reader =
context_provider->GetGLHelper()->GetReadbackPipelineYUV(
surface_origin != kTopLeft_GrSurfaceOrigin);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment