use smart pointer for paint_canvas
This commit is contained in:
parent
4b10445c2e
commit
26daffea9c
1 changed files with 3 additions and 4 deletions
|
@ -226,13 +226,13 @@ void AutofillPopupView::OnPaint(gfx::Canvas* canvas) {
|
||||||
SkBitmap bitmap;
|
SkBitmap bitmap;
|
||||||
|
|
||||||
#if defined(ENABLE_OSR)
|
#if defined(ENABLE_OSR)
|
||||||
cc::SkiaPaintCanvas* paint_canvas = nullptr;
|
std::unique_ptr<cc::SkiaPaintCanvas> paint_canvas;
|
||||||
if (view_proxy_.get()) {
|
if (view_proxy_.get()) {
|
||||||
bitmap.allocN32Pixels(popup_->popup_bounds_in_view_.width(),
|
bitmap.allocN32Pixels(popup_->popup_bounds_in_view_.width(),
|
||||||
popup_->popup_bounds_in_view_.height(),
|
popup_->popup_bounds_in_view_.height(),
|
||||||
true);
|
true);
|
||||||
paint_canvas = new cc::SkiaPaintCanvas(bitmap);
|
paint_canvas.reset(new cc::SkiaPaintCanvas(bitmap));
|
||||||
draw_canvas = new gfx::Canvas(paint_canvas, 1.0);
|
draw_canvas = new gfx::Canvas(paint_canvas.get(), 1.0);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -250,7 +250,6 @@ void AutofillPopupView::OnPaint(gfx::Canvas* canvas) {
|
||||||
if (view_proxy_.get()) {
|
if (view_proxy_.get()) {
|
||||||
view_proxy_->SetBounds(popup_->popup_bounds_in_view_);
|
view_proxy_->SetBounds(popup_->popup_bounds_in_view_);
|
||||||
view_proxy_->SetBitmap(bitmap);
|
view_proxy_->SetBitmap(bitmap);
|
||||||
delete paint_canvas;
|
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue