OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser/renderer_host/render_widget_host_view_win.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_win.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 } | 155 } |
156 | 156 |
157 // Draw the contents of |backing_store_dc| onto |paint_rect| with a 70% grey | 157 // Draw the contents of |backing_store_dc| onto |paint_rect| with a 70% grey |
158 // filter. | 158 // filter. |
159 void DrawDeemphasized(const SkColor& color, | 159 void DrawDeemphasized(const SkColor& color, |
160 const gfx::Rect& paint_rect, | 160 const gfx::Rect& paint_rect, |
161 HDC backing_store_dc, | 161 HDC backing_store_dc, |
162 HDC paint_dc) { | 162 HDC paint_dc) { |
163 gfx::CanvasSkia canvas(paint_rect.width(), paint_rect.height(), true); | 163 gfx::CanvasSkia canvas(paint_rect.width(), paint_rect.height(), true); |
164 { | 164 { |
165 skia::ScopedPlatformPaint scoped_platform_paint(&canvas); | 165 skia::ScopedPlatformPaint scoped_platform_paint(canvas.sk_canvas()); |
166 HDC dc = scoped_platform_paint.GetPlatformSurface(); | 166 HDC dc = scoped_platform_paint.GetPlatformSurface(); |
167 BitBlt(dc, | 167 BitBlt(dc, |
168 0, | 168 0, |
169 0, | 169 0, |
170 paint_rect.width(), | 170 paint_rect.width(), |
171 paint_rect.height(), | 171 paint_rect.height(), |
172 backing_store_dc, | 172 backing_store_dc, |
173 paint_rect.x(), | 173 paint_rect.x(), |
174 paint_rect.y(), | 174 paint_rect.y(), |
175 SRCCOPY); | 175 SRCCOPY); |
176 } | 176 } |
177 canvas.FillRectInt(color, 0, 0, paint_rect.width(), paint_rect.height()); | 177 canvas.FillRectInt(color, 0, 0, paint_rect.width(), paint_rect.height()); |
178 skia::DrawToNativeContext(&canvas, paint_dc, paint_rect.x(), | 178 skia::DrawToNativeContext(canvas.sk_canvas(), paint_dc, paint_rect.x(), |
179 paint_rect.y(), NULL); | 179 paint_rect.y(), NULL); |
180 } | 180 } |
181 | 181 |
182 // The plugin wrapper window which lives in the browser process has this proc | 182 // The plugin wrapper window which lives in the browser process has this proc |
183 // as its window procedure. We only handle the WM_PARENTNOTIFY message sent by | 183 // as its window procedure. We only handle the WM_PARENTNOTIFY message sent by |
184 // windowed plugins for mouse input. This is forwarded off to the wrappers | 184 // windowed plugins for mouse input. This is forwarded off to the wrappers |
185 // parent which is typically the RVH window which turns on user gesture. | 185 // parent which is typically the RVH window which turns on user gesture. |
186 LRESULT CALLBACK PluginWrapperWindowProc(HWND window, unsigned int message, | 186 LRESULT CALLBACK PluginWrapperWindowProc(HWND window, unsigned int message, |
187 WPARAM wparam, LPARAM lparam) { | 187 WPARAM wparam, LPARAM lparam) { |
188 if (message == WM_PARENTNOTIFY) { | 188 if (message == WM_PARENTNOTIFY) { |
(...skipping 770 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
959 gfx::CanvasSkia canvas(dirty_rect.right - dirty_rect.left, | 959 gfx::CanvasSkia canvas(dirty_rect.right - dirty_rect.left, |
960 dirty_rect.bottom - dirty_rect.top, | 960 dirty_rect.bottom - dirty_rect.top, |
961 true); // opaque | 961 true); // opaque |
962 canvas.TranslateInt(-dirty_rect.left, -dirty_rect.top); | 962 canvas.TranslateInt(-dirty_rect.left, -dirty_rect.top); |
963 | 963 |
964 const RECT& dc_rect = dc->m_ps.rcPaint; | 964 const RECT& dc_rect = dc->m_ps.rcPaint; |
965 canvas.TileImageInt(background_, 0, 0, | 965 canvas.TileImageInt(background_, 0, 0, |
966 dc_rect.right - dc_rect.left, | 966 dc_rect.right - dc_rect.left, |
967 dc_rect.bottom - dc_rect.top); | 967 dc_rect.bottom - dc_rect.top); |
968 | 968 |
969 skia::DrawToNativeContext(&canvas, *dc, dirty_rect.left, dirty_rect.top, | 969 skia::DrawToNativeContext(canvas.sk_canvas(), *dc, dirty_rect.left, |
970 NULL); | 970 dirty_rect.top, NULL); |
971 } else { | 971 } else { |
972 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); | 972 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); |
973 dc->FillRect(&dirty_rect, white_brush); | 973 dc->FillRect(&dirty_rect, white_brush); |
974 } | 974 } |
975 } | 975 } |
976 | 976 |
977 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) { | 977 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) { |
978 // Do nothing. This suppresses the resize corner that Windows would | 978 // Do nothing. This suppresses the resize corner that Windows would |
979 // otherwise draw for us. | 979 // otherwise draw for us. |
980 } | 980 } |
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1941 if (message == WM_MOUSEMOVE) { | 1941 if (message == WM_MOUSEMOVE) { |
1942 CPoint center = GetClientCenter(); | 1942 CPoint center = GetClientCenter(); |
1943 // Ignore WM_MOUSEMOVE messages generated by MoveCursorToCenter(). | 1943 // Ignore WM_MOUSEMOVE messages generated by MoveCursorToCenter(). |
1944 if (LOWORD(lparam) == center.x && HIWORD(lparam) == center.y) | 1944 if (LOWORD(lparam) == center.x && HIWORD(lparam) == center.y) |
1945 return; | 1945 return; |
1946 } | 1946 } |
1947 | 1947 |
1948 ForwardMouseEventToRenderer(message, wparam, lparam); | 1948 ForwardMouseEventToRenderer(message, wparam, lparam); |
1949 } | 1949 } |
1950 | 1950 |
OLD | NEW |