| 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 "webkit/tools/test_shell/webwidget_host.h" | 5 #include "webkit/tools/test_shell/webwidget_host.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "skia/ext/platform_canvas.h" | 8 #include "skia/ext/platform_canvas.h" |
| 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 9 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPopupMenu.h" |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 | 272 |
| 273 DLOG_IF(WARNING, i == 1) << "painting caused additional invalidations"; | 273 DLOG_IF(WARNING, i == 1) << "painting caused additional invalidations"; |
| 274 PaintRect(rect); | 274 PaintRect(rect); |
| 275 } | 275 } |
| 276 } | 276 } |
| 277 DCHECK(paint_rect_.IsEmpty()); | 277 DCHECK(paint_rect_.IsEmpty()); |
| 278 | 278 |
| 279 // Paint to the screen | 279 // Paint to the screen |
| 280 PAINTSTRUCT ps; | 280 PAINTSTRUCT ps; |
| 281 BeginPaint(view_, &ps); | 281 BeginPaint(view_, &ps); |
| 282 canvas_->getTopPlatformDevice().drawToHDC(ps.hdc, | 282 skia::platform_util::DrawToHDC(&canvas_->getTopDevice(), ps.hdc, |
| 283 ps.rcPaint.left, | 283 ps.rcPaint.left, ps.rcPaint.top, |
| 284 ps.rcPaint.top, | 284 &ps.rcPaint); |
| 285 &ps.rcPaint); | |
| 286 EndPaint(view_, &ps); | 285 EndPaint(view_, &ps); |
| 287 | 286 |
| 288 // Draw children | 287 // Draw children |
| 289 UpdateWindow(view_); | 288 UpdateWindow(view_); |
| 290 } | 289 } |
| 291 | 290 |
| 292 WebScreenInfo WebWidgetHost::GetScreenInfo() { | 291 WebScreenInfo WebWidgetHost::GetScreenInfo() { |
| 293 return WebScreenInfoFactory::screenInfo(view_); | 292 return WebScreenInfoFactory::screenInfo(view_); |
| 294 } | 293 } |
| 295 | 294 |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { | 374 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { |
| 376 #ifndef NDEBUG | 375 #ifndef NDEBUG |
| 377 DCHECK(!painting_); | 376 DCHECK(!painting_); |
| 378 #endif | 377 #endif |
| 379 DCHECK(canvas_.get()); | 378 DCHECK(canvas_.get()); |
| 380 | 379 |
| 381 set_painting(true); | 380 set_painting(true); |
| 382 webwidget_->paint(canvas_.get(), rect); | 381 webwidget_->paint(canvas_.get(), rect); |
| 383 set_painting(false); | 382 set_painting(false); |
| 384 } | 383 } |
| OLD | NEW |