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/Platform/chromium/public/WebSize.h" | 9 #include "third_party/WebKit/Source/Platform/chromium/public/WebSize.h" |
10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 10 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 void WebWidgetHost::ScheduleComposite() { | 179 void WebWidgetHost::ScheduleComposite() { |
180 if (!webwidget_) | 180 if (!webwidget_) |
181 return; | 181 return; |
182 WebSize size = webwidget_->size(); | 182 WebSize size = webwidget_->size(); |
183 gfx::Rect rect(0, 0, size.width, size.height); | 183 gfx::Rect rect(0, 0, size.width, size.height); |
184 RECT r = rect.ToRECT(); | 184 RECT r = rect.ToRECT(); |
185 InvalidateRect(view_, &r, FALSE); | 185 InvalidateRect(view_, &r, FALSE); |
186 } | 186 } |
187 | 187 |
188 void WebWidgetHost::SetCursor(HCURSOR cursor) { | 188 void WebWidgetHost::SetCursor(HCURSOR cursor) { |
189 SetClassLong(view_, GCL_HCURSOR, | 189 SetClassLongPtr(view_, GCLP_HCURSOR, reinterpret_cast<LONG_PTR>(cursor)); |
190 static_cast<LONG>(reinterpret_cast<LONG_PTR>(cursor))); | |
191 ::SetCursor(cursor); | 190 ::SetCursor(cursor); |
192 } | 191 } |
193 | 192 |
194 void WebWidgetHost::DiscardBackingStore() { | 193 void WebWidgetHost::DiscardBackingStore() { |
195 canvas_.reset(); | 194 canvas_.reset(); |
196 } | 195 } |
197 | 196 |
198 WebWidgetHost::WebWidgetHost() | 197 WebWidgetHost::WebWidgetHost() |
199 : view_(NULL), | 198 : view_(NULL), |
200 webwidget_(NULL), | 199 webwidget_(NULL), |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { | 372 void WebWidgetHost::PaintRect(const gfx::Rect& rect) { |
374 #ifndef NDEBUG | 373 #ifndef NDEBUG |
375 DCHECK(!painting_); | 374 DCHECK(!painting_); |
376 #endif | 375 #endif |
377 DCHECK(canvas_.get()); | 376 DCHECK(canvas_.get()); |
378 | 377 |
379 set_painting(true); | 378 set_painting(true); |
380 webwidget_->paint(canvas_.get(), rect); | 379 webwidget_->paint(canvas_.get(), rect); |
381 set_painting(false); | 380 set_painting(false); |
382 } | 381 } |
OLD | NEW |