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

Unified Diff: cc/layers/heads_up_display_layer_impl.cc

Issue 950923002: Convert CC HUD from GDI bitmap to SkSurface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@revert-win32k-font
Patch Set: rebase Created 5 years, 10 months 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/layers/heads_up_display_layer_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/layers/heads_up_display_layer_impl.cc
diff --git a/cc/layers/heads_up_display_layer_impl.cc b/cc/layers/heads_up_display_layer_impl.cc
index 6d184f325fad2da8dc9c4b4ceb24610213769106..2ed00a67f1291826a774384d6f414c8a1b321d76 100644
--- a/cc/layers/heads_up_display_layer_impl.cc
+++ b/cc/layers/heads_up_display_layer_impl.cc
@@ -179,39 +179,38 @@ void HeadsUpDisplayLayerImpl::UpdateHudTexture(
return;
SkISize canvas_size;
- if (hud_canvas_)
- canvas_size = hud_canvas_->getDeviceSize();
+ if (hud_surface_)
+ canvas_size = hud_surface_->getCanvas()->getDeviceSize();
else
canvas_size.set(0, 0);
if (canvas_size.width() != internal_content_bounds_.width() ||
canvas_size.height() != internal_content_bounds_.height() ||
- !hud_canvas_) {
+ !hud_surface_) {
TRACE_EVENT0("cc", "ResizeHudCanvas");
- bool opaque = false;
- hud_canvas_ = make_scoped_ptr(
- skia::CreateBitmapCanvas(internal_content_bounds_.width(),
- internal_content_bounds_.height(), opaque));
+ hud_surface_ = skia::AdoptRef(SkSurface::NewRasterN32Premul(
+ internal_content_bounds_.width(), internal_content_bounds_.height()));
}
UpdateHudContents();
{
TRACE_EVENT0("cc", "DrawHudContents");
- hud_canvas_->clear(SkColorSetARGB(0, 0, 0, 0));
- hud_canvas_->save();
- hud_canvas_->scale(internal_contents_scale_, internal_contents_scale_);
+ hud_surface_->getCanvas()->clear(SkColorSetARGB(0, 0, 0, 0));
+ hud_surface_->getCanvas()->save();
+ hud_surface_->getCanvas()->scale(internal_contents_scale_,
+ internal_contents_scale_);
- DrawHudContents(hud_canvas_.get());
+ DrawHudContents(hud_surface_->getCanvas());
- hud_canvas_->restore();
+ hud_surface_->getCanvas()->restore();
}
TRACE_EVENT0("cc", "UploadHudTexture");
SkImageInfo info;
size_t row_bytes = 0;
- const void* pixels = hud_canvas_->peekPixels(&info, &row_bytes);
+ const void* pixels = hud_surface_->getCanvas()->peekPixels(&info, &row_bytes);
DCHECK(pixels);
DCHECK(info.colorType() == kN32_SkColorType);
resource_provider->CopyToResource(resources_.back()->id(),
« no previous file with comments | « cc/layers/heads_up_display_layer_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698