Chromium Code Reviews| Index: content/renderer/media/html_video_element_capturer_source.cc |
| diff --git a/content/renderer/media/html_video_element_capturer_source.cc b/content/renderer/media/html_video_element_capturer_source.cc |
| index f096b3d29681a6b04cfe4ff6f11a54b58eff80d7..3bc81d66d64044820f0b9bfb3874479027072bb3 100644 |
| --- a/content/renderer/media/html_video_element_capturer_source.cc |
| +++ b/content/renderer/media/html_video_element_capturer_source.cc |
| @@ -9,6 +9,8 @@ |
| #include "base/single_thread_task_runner.h" |
| #include "base/threading/thread_task_runner_handle.h" |
| #include "base/trace_event/trace_event.h" |
| +#include "cc/paint/paint_canvas.h" |
| +#include "cc/paint/paint_surface.h" |
| #include "content/public/renderer/render_thread.h" |
| #include "content/renderer/media/media_stream_video_source.h" |
| #include "content/renderer/media/webrtc_uma_histograms.h" |
| @@ -19,8 +21,6 @@ |
| #include "third_party/WebKit/public/platform/WebRect.h" |
| #include "third_party/WebKit/public/platform/WebSize.h" |
| #include "third_party/libyuv/include/libyuv.h" |
| -#include "third_party/skia/include/core/SkCanvas.h" |
| -#include "third_party/skia/include/core/SkSurface.h" |
| namespace { |
| const float kMinFramesPerSecond = 1.0; |
| @@ -94,8 +94,8 @@ void HtmlVideoElementCapturerSource::StartCapture( |
| return; |
| } |
| const blink::WebSize resolution = web_media_player_->naturalSize(); |
| - surface_ = |
| - SkSurface::MakeRasterN32Premul(resolution.width, resolution.height); |
| + surface_ = cc::PaintSurface::MakeRasterN32Premul(resolution.width, |
| + resolution.height); |
| if (!surface_) { |
| running_callback_.Run(false); |
| return; |
| @@ -133,16 +133,16 @@ void HtmlVideoElementCapturerSource::sendNewFrame() { |
| const base::TimeTicks current_time = base::TimeTicks::Now(); |
| const blink::WebSize resolution = web_media_player_->naturalSize(); |
| - SkCanvas* canvas = surface_->getCanvas(); |
| - SkPaint paint; |
| + cc::PaintCanvas* canvas = surface_->getCanvas(); |
| + cc::PaintFlags paint; |
| paint.setBlendMode(SkBlendMode::kSrc); |
| paint.setFilterQuality(kLow_SkFilterQuality); |
| web_media_player_->paint( |
| - canvas, blink::WebRect(0, 0, resolution.width, resolution.height), |
| - paint); |
| - DCHECK_NE(kUnknown_SkColorType, canvas->imageInfo().colorType()); |
| - DCHECK_EQ(canvas->imageInfo().width(), resolution.width); |
| - DCHECK_EQ(canvas->imageInfo().height(), resolution.height); |
| + canvas, blink::WebRect(0, 0, resolution.width, resolution.height), paint); |
| + DCHECK_NE(kUnknown_SkColorType, |
| + cc::GetSkCanvas(canvas)->imageInfo().colorType()); |
|
danakj
2017/01/20 23:34:14
do these have to go thru GetSkCanvas? Can we do so
|
| + DCHECK_EQ(cc::GetSkCanvas(canvas)->imageInfo().width(), resolution.width); |
| + DCHECK_EQ(cc::GetSkCanvas(canvas)->imageInfo().height(), resolution.height); |
| const SkBitmap bitmap = skia::ReadPixels(canvas); |
| DCHECK_NE(kUnknown_SkColorType, bitmap.colorType()); |