Tab Capture in VIZ: CopyOutputRequest/Result API changes.

https://chromium-review.googlesource.com/637003
This commit is contained in:
Aleksei Kuzmin 2018-03-13 16:06:50 +09:00
parent 639be7f7bc
commit d3afb595dc

View file

@ -128,8 +128,9 @@ class AtomCopyFrameGenerator {
if (!view_->render_widget_host() || !view_->IsPainting())
return;
std::unique_ptr<viz::CopyOutputRequest> request =
viz::CopyOutputRequest::CreateBitmapRequest(base::Bind(
auto request = std::make_unique<viz::CopyOutputRequest>(
viz::CopyOutputRequest::ResultFormat::RGBA_BITMAP,
base::BindOnce(
&AtomCopyFrameGenerator::CopyFromCompositingSurfaceHasResult,
weak_ptr_factory_.GetWeakPtr(),
damage_rect));
@ -153,9 +154,9 @@ class AtomCopyFrameGenerator {
return;
}
DCHECK(result->HasBitmap());
std::unique_ptr<SkBitmap> source = result->TakeBitmap();
DCHECK(source);
DCHECK(!result->IsEmpty());
auto source = std::make_unique<SkBitmap>(result->AsSkBitmap());
DCHECK(source->readyToDraw());
if (source) {
base::AutoLock autolock(lock_);
std::shared_ptr<SkBitmap> bitmap(source.release());