OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/renderer/render_widget.h" | 5 #include "content/renderer/render_widget.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 1472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1483 if (is_accelerated_compositing_active_) { | 1483 if (is_accelerated_compositing_active_) { |
1484 webwidget_->setNeedsRedraw(); | 1484 webwidget_->setNeedsRedraw(); |
1485 scheduleComposite(); | 1485 scheduleComposite(); |
1486 } else { | 1486 } else { |
1487 gfx::Rect repaint_rect(size_to_paint.width(), size_to_paint.height()); | 1487 gfx::Rect repaint_rect(size_to_paint.width(), size_to_paint.height()); |
1488 didInvalidateRect(repaint_rect); | 1488 didInvalidateRect(repaint_rect); |
1489 } | 1489 } |
1490 } | 1490 } |
1491 | 1491 |
1492 void RenderWidget::OnSetDeviceScaleFactor(float device_scale_factor) { | 1492 void RenderWidget::OnSetDeviceScaleFactor(float device_scale_factor) { |
1493 // TODO(thakis): Set device_scale_factor_, possibly trigger a repaint. | 1493 if (device_scale_factor_ == device_scale_factor) |
| 1494 return; |
| 1495 |
| 1496 device_scale_factor_ = device_scale_factor; |
| 1497 |
| 1498 if (!is_accelerated_compositing_active_) { |
| 1499 didInvalidateRect(gfx::Rect(size_.width(), size_.height())); |
| 1500 } else { |
| 1501 scheduleComposite(); |
| 1502 } |
1494 } | 1503 } |
1495 | 1504 |
1496 void RenderWidget::OnSetTextDirection(WebTextDirection direction) { | 1505 void RenderWidget::OnSetTextDirection(WebTextDirection direction) { |
1497 if (!webwidget_) | 1506 if (!webwidget_) |
1498 return; | 1507 return; |
1499 webwidget_->setTextDirection(direction); | 1508 webwidget_->setTextDirection(direction); |
1500 } | 1509 } |
1501 | 1510 |
1502 webkit::ppapi::PluginInstance* RenderWidget::GetBitmapForOptimizedPluginPaint( | 1511 webkit::ppapi::PluginInstance* RenderWidget::GetBitmapForOptimizedPluginPaint( |
1503 const gfx::Rect& paint_bounds, | 1512 const gfx::Rect& paint_bounds, |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1743 } | 1752 } |
1744 } | 1753 } |
1745 | 1754 |
1746 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { | 1755 bool RenderWidget::WillHandleMouseEvent(const WebKit::WebMouseEvent& event) { |
1747 return false; | 1756 return false; |
1748 } | 1757 } |
1749 | 1758 |
1750 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { | 1759 bool RenderWidget::WebWidgetHandlesCompositorScheduling() const { |
1751 return false; | 1760 return false; |
1752 } | 1761 } |
OLD | NEW |