Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1066)

Unified Diff: content/renderer/media/html_video_element_capturer_source.cc

Issue 2523673004: [NOT FOR COMMIT] Fully replace SkCanvas uses.
Patch Set: Support Android build. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..74e7633ea7db7d5a82ebc181914473fe8783e2be 100644
--- a/content/renderer/media/html_video_element_capturer_source.cc
+++ b/content/renderer/media/html_video_element_capturer_source.cc
@@ -14,6 +14,7 @@
#include "content/renderer/media/webrtc_uma_histograms.h"
#include "media/base/limits.h"
#include "media/blink/webmediaplayer_impl.h"
+#include "skia/ext/cdl_surface.h"
#include "skia/ext/platform_canvas.h"
#include "third_party/WebKit/public/platform/WebMediaPlayer.h"
#include "third_party/WebKit/public/platform/WebRect.h"
@@ -95,7 +96,7 @@ void HtmlVideoElementCapturerSource::StartCapture(
}
const blink::WebSize resolution = web_media_player_->naturalSize();
surface_ =
- SkSurface::MakeRasterN32Premul(resolution.width, resolution.height);
+ CdlSurface::MakeRasterN32Premul(resolution.width, resolution.height);
if (!surface_) {
running_callback_.Run(false);
return;
@@ -133,16 +134,15 @@ 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;
+ CdlCanvas* canvas = surface_->getCanvas();
+ CdlPaint 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, GetSkCanvas(canvas)->imageInfo().colorType());
+ DCHECK_EQ(GetSkCanvas(canvas)->imageInfo().width(), resolution.width);
+ DCHECK_EQ(GetSkCanvas(canvas)->imageInfo().height(), resolution.height);
const SkBitmap bitmap = skia::ReadPixels(canvas);
DCHECK_NE(kUnknown_SkColorType, bitmap.colorType());
« no previous file with comments | « content/renderer/media/html_video_element_capturer_source.h ('k') | content/renderer/media/image_capture_frame_grabber.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698