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

Unified Diff: content/browser/renderer_host/render_widget_host_view_win.cc

Issue 11269022: Add Vector2d classes that represent offsets, instead of using Point. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RenderText fixup Created 8 years, 2 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
Index: content/browser/renderer_host/render_widget_host_view_win.cc
diff --git a/content/browser/renderer_host/render_widget_host_view_win.cc b/content/browser/renderer_host/render_widget_host_view_win.cc
index 44ab814e778bf6ef23224ee7e509b70af3cff59b..9feecbf817b8ac3314edb38a4238ca204420236c 100644
--- a/content/browser/renderer_host/render_widget_host_view_win.cc
+++ b/content/browser/renderer_host/render_widget_host_view_win.cc
@@ -537,7 +537,7 @@ RenderWidgetHostViewWin::GetNativeViewAccessible() {
}
void RenderWidgetHostViewWin::MovePluginWindows(
- const gfx::Point& scroll_offset,
+ const gfx::Vector2d& scroll_offset,
const std::vector<webkit::npapi::WebPluginGeometry>& plugin_window_moves) {
MovePluginWindowsHelper(m_hWnd, plugin_window_moves);
}
@@ -713,9 +713,8 @@ void RenderWidgetHostViewWin::Redraw() {
RedrawWindow(NULL, damage_region, RDW_UPDATENOW | RDW_NOCHILDREN);
// Send the invalid rect in screen coordinates.
- gfx::Rect screen_rect = GetViewBounds();
gfx::Rect invalid_screen_rect(damage_bounds);
- invalid_screen_rect.Offset(screen_rect.x(), screen_rect.y());
+ invalid_screen_rect.Offset(GetViewBounds().OffsetFromOrigin());
PaintPluginWindowsHelper(m_hWnd, invalid_screen_rect);
}
@@ -1327,7 +1326,7 @@ void RenderWidgetHostViewWin::DrawBackground(const RECT& dirty_rect,
if (!background_.empty()) {
gfx::Rect dirty_area(dirty_rect);
gfx::Canvas canvas(dirty_area.size(), ui::SCALE_FACTOR_100P, true);
- canvas.Translate(gfx::Point().Subtract(dirty_area.origin()));
+ canvas.Translate(-dirty_area.OffsetFromOrigin());
gfx::Rect dc_rect(dc->m_ps.rcPaint);
// TODO(pkotwicz): Fix |background_| such that it is an ImageSkia.

Powered by Google App Engine
This is Rietveld 408576698