| Index: content/renderer/render_widget.cc
|
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
| index 14b716e5315b5d53e2b444482d3831ea79f7886b..6994e1a74a85a5e837a74edeb38d22fe18968649 100644
|
| --- a/content/renderer/render_widget.cc
|
| +++ b/content/renderer/render_widget.cc
|
| @@ -105,12 +105,16 @@ RenderWidget::RenderWidget(WebKit::WebPopupType popup_type,
|
| animation_update_pending_(false),
|
| invalidation_task_posted_(false),
|
| screen_info_(screen_info),
|
| + device_scale_factor_(1),
|
| invert_(false) {
|
| if (!swapped_out)
|
| RenderProcess::current()->AddRefProcess();
|
| DCHECK(RenderThread::Get());
|
| has_disable_gpu_vsync_switch_ = CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kDisableGpuVsync);
|
| +#if defined(OS_CHROMEOS)
|
| + device_scale_factor_ = screen_info.verticalDPI / 160;
|
| +#endif
|
| }
|
|
|
| RenderWidget::~RenderWidget() {
|
| @@ -933,9 +937,10 @@ void RenderWidget::DoDeferredUpdate() {
|
| pending_update_params_->copy_rects.push_back(optimized_copy_rect);
|
| } else if (!is_accelerated_compositing_active_) {
|
| // Compute a buffer for painting and cache it.
|
| + gfx::Rect pixel_bounds = bounds.Scale(device_scale_factor_);
|
| scoped_ptr<skia::PlatformCanvas> canvas(
|
| RenderProcess::current()->GetDrawingCanvas(¤t_paint_buf_,
|
| - bounds));
|
| + pixel_bounds));
|
| if (!canvas.get()) {
|
| NOTREACHED();
|
| return;
|
| @@ -943,10 +948,12 @@ void RenderWidget::DoDeferredUpdate() {
|
|
|
| // We may get back a smaller canvas than we asked for.
|
| // TODO(darin): This seems like it could cause painting problems!
|
| - DCHECK_EQ(bounds.width(), canvas->getDevice()->width());
|
| - DCHECK_EQ(bounds.height(), canvas->getDevice()->height());
|
| - bounds.set_width(canvas->getDevice()->width());
|
| - bounds.set_height(canvas->getDevice()->height());
|
| + DCHECK_EQ(pixel_bounds.width(), canvas->getDevice()->width());
|
| + DCHECK_EQ(pixel_bounds.height(), canvas->getDevice()->height());
|
| + pixel_bounds.set_width(canvas->getDevice()->width());
|
| + pixel_bounds.set_height(canvas->getDevice()->height());
|
| + bounds.set_width(pixel_bounds.width() / device_scale_factor_);
|
| + bounds.set_height(pixel_bounds.height() / device_scale_factor_);
|
|
|
| HISTOGRAM_COUNTS_100("MPArch.RW_PaintRectCount", update.paint_rects.size());
|
|
|
| @@ -960,7 +967,7 @@ void RenderWidget::DoDeferredUpdate() {
|
| copy_rects.push_back(scroll_damage);
|
|
|
| for (size_t i = 0; i < copy_rects.size(); ++i)
|
| - PaintRect(copy_rects[i], bounds.origin(), canvas.get());
|
| + PaintRect(copy_rects[i], pixel_bounds.origin(), canvas.get());
|
|
|
| // Software FPS tick for performance tests. The accelerated path traces the
|
| // frame events in didCommitAndDrawCompositorFrame. See throughput_tests.cc.
|
|
|