Chromium Code Reviews| 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 "chrome/browser/renderer_host/render_widget_host_view_win.h" | 5 #include "chrome/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 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 174 0, | 174 0, |
| 175 0, | 175 0, |
| 176 paint_rect.width(), | 176 paint_rect.width(), |
| 177 paint_rect.height(), | 177 paint_rect.height(), |
| 178 backing_store_dc, | 178 backing_store_dc, |
| 179 paint_rect.x(), | 179 paint_rect.x(), |
| 180 paint_rect.y(), | 180 paint_rect.y(), |
| 181 SRCCOPY); | 181 SRCCOPY); |
| 182 canvas.endPlatformPaint(); | 182 canvas.endPlatformPaint(); |
| 183 canvas.FillRectInt(color, 0, 0, paint_rect.width(), paint_rect.height()); | 183 canvas.FillRectInt(color, 0, 0, paint_rect.width(), paint_rect.height()); |
| 184 canvas.getTopPlatformDevice().drawToHDC(paint_dc, paint_rect.x(), | 184 skia::platform_util::DrawToHDC(&canvas.getTopDevice(), paint_dc, |
|
alokp
2011/05/18 03:25:42
Could we rename this to DrawToNativeContext and ch
Jeff Timanus
2011/05/18 22:10:28
Done. I added a new routine in platform_canvas th
| |
| 185 paint_rect.y(), NULL); | 185 paint_rect.x(), paint_rect.y(), NULL); |
| 186 } | 186 } |
| 187 | 187 |
| 188 // The plugin wrapper window which lives in the browser process has this proc | 188 // The plugin wrapper window which lives in the browser process has this proc |
| 189 // as its window procedure. We only handle the WM_PARENTNOTIFY message sent by | 189 // as its window procedure. We only handle the WM_PARENTNOTIFY message sent by |
| 190 // windowed plugins for mouse input. This is forwarded off to the wrappers | 190 // windowed plugins for mouse input. This is forwarded off to the wrappers |
| 191 // parent which is typically the RVH window which turns on user gesture. | 191 // parent which is typically the RVH window which turns on user gesture. |
| 192 LRESULT CALLBACK PluginWrapperWindowProc(HWND window, unsigned int message, | 192 LRESULT CALLBACK PluginWrapperWindowProc(HWND window, unsigned int message, |
| 193 WPARAM wparam, LPARAM lparam) { | 193 WPARAM wparam, LPARAM lparam) { |
| 194 if (message == WM_PARENTNOTIFY) { | 194 if (message == WM_PARENTNOTIFY) { |
| 195 switch (LOWORD(wparam)) { | 195 switch (LOWORD(wparam)) { |
| (...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 954 gfx::CanvasSkia canvas(dirty_rect.right - dirty_rect.left, | 954 gfx::CanvasSkia canvas(dirty_rect.right - dirty_rect.left, |
| 955 dirty_rect.bottom - dirty_rect.top, | 955 dirty_rect.bottom - dirty_rect.top, |
| 956 true); // opaque | 956 true); // opaque |
| 957 canvas.TranslateInt(-dirty_rect.left, -dirty_rect.top); | 957 canvas.TranslateInt(-dirty_rect.left, -dirty_rect.top); |
| 958 | 958 |
| 959 const RECT& dc_rect = dc->m_ps.rcPaint; | 959 const RECT& dc_rect = dc->m_ps.rcPaint; |
| 960 canvas.TileImageInt(background_, 0, 0, | 960 canvas.TileImageInt(background_, 0, 0, |
| 961 dc_rect.right - dc_rect.left, | 961 dc_rect.right - dc_rect.left, |
| 962 dc_rect.bottom - dc_rect.top); | 962 dc_rect.bottom - dc_rect.top); |
| 963 | 963 |
| 964 canvas.getTopPlatformDevice().drawToHDC(*dc, dirty_rect.left, | 964 skia::platform_util::DrawToHDC(&canvas.getTopDevice(), *dc, |
| 965 dirty_rect.top, NULL); | 965 dirty_rect.left, dirty_rect.top, NULL); |
| 966 } else { | 966 } else { |
| 967 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); | 967 HBRUSH white_brush = reinterpret_cast<HBRUSH>(GetStockObject(WHITE_BRUSH)); |
| 968 dc->FillRect(&dirty_rect, white_brush); | 968 dc->FillRect(&dirty_rect, white_brush); |
| 969 } | 969 } |
| 970 } | 970 } |
| 971 | 971 |
| 972 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) { | 972 void RenderWidgetHostViewWin::OnNCPaint(HRGN update_region) { |
| 973 // Do nothing. This suppresses the resize corner that Windows would | 973 // Do nothing. This suppresses the resize corner that Windows would |
| 974 // otherwise draw for us. | 974 // otherwise draw for us. |
| 975 } | 975 } |
| (...skipping 802 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1778 } | 1778 } |
| 1779 | 1779 |
| 1780 // static | 1780 // static |
| 1781 RenderWidgetHostView* | 1781 RenderWidgetHostView* |
| 1782 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( | 1782 RenderWidgetHostView::GetRenderWidgetHostViewFromNativeView( |
| 1783 gfx::NativeView native_view) { | 1783 gfx::NativeView native_view) { |
| 1784 return ::IsWindow(native_view) ? | 1784 return ::IsWindow(native_view) ? |
| 1785 reinterpret_cast<RenderWidgetHostView*>( | 1785 reinterpret_cast<RenderWidgetHostView*>( |
| 1786 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; | 1786 ViewProp::GetValue(native_view, kRenderWidgetHostViewKey)) : NULL; |
| 1787 } | 1787 } |
| OLD | NEW |