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

Unified Diff: cc/output/software_output_device.cc

Issue 791753002: SkCanvas::NewRaster is deprecated, create a surface instead (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update x11 Created 6 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
« no previous file with comments | « cc/output/software_output_device.h ('k') | content/browser/compositor/software_output_device_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/software_output_device.cc
diff --git a/cc/output/software_output_device.cc b/cc/output/software_output_device.cc
index 0c374c9afb4b2d1f8a3f284c2448bdcb2738525c..f7bc61a841179a7b8cdc4b223135c027c02e68a1 100644
--- a/cc/output/software_output_device.cc
+++ b/cc/output/software_output_device.cc
@@ -27,13 +27,13 @@ void SoftwareOutputDevice::Resize(const gfx::Size& viewport_pixel_size,
viewport_pixel_size.height(),
kOpaque_SkAlphaType);
viewport_pixel_size_ = viewport_pixel_size;
- canvas_ = skia::AdoptRef(SkCanvas::NewRaster(info));
+ surface_ = skia::AdoptRef(SkSurface::NewRaster(info));
}
SkCanvas* SoftwareOutputDevice::BeginPaint(const gfx::Rect& damage_rect) {
- DCHECK(canvas_);
+ DCHECK(surface_);
damage_rect_ = damage_rect;
- return canvas_.get();
+ return surface_->getCanvas();
}
void SoftwareOutputDevice::EndPaint(SoftwareFrameData* frame_data) {
@@ -44,9 +44,10 @@ void SoftwareOutputDevice::EndPaint(SoftwareFrameData* frame_data) {
}
void SoftwareOutputDevice::CopyToPixels(const gfx::Rect& rect, void* pixels) {
- DCHECK(canvas_);
+ DCHECK(surface_);
SkImageInfo info = SkImageInfo::MakeN32Premul(rect.width(), rect.height());
- canvas_->readPixels(info, pixels, info.minRowBytes(), rect.x(), rect.y());
+ surface_->getCanvas()->readPixels(info, pixels, info.minRowBytes(), rect.x(),
+ rect.y());
}
void SoftwareOutputDevice::Scroll(const gfx::Vector2d& delta,
« no previous file with comments | « cc/output/software_output_device.h ('k') | content/browser/compositor/software_output_device_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698