OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/plugins/ppapi/ppb_scrollbar_impl.h" | 5 #include "webkit/plugins/ppapi/ppb_scrollbar_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "ppapi/c/dev/ppp_scrollbar_dev.h" | 10 #include "ppapi/c/dev/ppp_scrollbar_dev.h" |
11 #include "ppapi/thunk/thunk.h" | 11 #include "ppapi/thunk/thunk.h" |
12 #include "skia/ext/platform_canvas.h" | 12 #include "skia/ext/platform_canvas.h" |
| 13 #include "third_party/WebKit/Source/Platform/chromium/public/WebCanvas.h" |
13 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" | 14 #include "third_party/WebKit/Source/Platform/chromium/public/WebRect.h" |
14 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" | 15 #include "third_party/WebKit/Source/Platform/chromium/public/WebVector.h" |
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" | 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginScrollbar.h" | 17 #include "third_party/WebKit/Source/WebKit/chromium/public/WebPluginScrollbar.h" |
17 #include "webkit/plugins/ppapi/common.h" | 18 #include "webkit/plugins/ppapi/common.h" |
18 #include "webkit/plugins/ppapi/event_conversion.h" | 19 #include "webkit/plugins/ppapi/event_conversion.h" |
19 #include "webkit/plugins/ppapi/plugin_module.h" | 20 #include "webkit/plugins/ppapi/plugin_module.h" |
20 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" | 21 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" |
21 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" | 22 #include "webkit/plugins/ppapi/ppb_image_data_impl.h" |
22 #include "webkit/plugins/ppapi/resource_helper.h" | 23 #include "webkit/plugins/ppapi/resource_helper.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
132 } | 133 } |
133 | 134 |
134 PP_Bool PPB_Scrollbar_Impl::PaintInternal(const gfx::Rect& rect, | 135 PP_Bool PPB_Scrollbar_Impl::PaintInternal(const gfx::Rect& rect, |
135 PPB_ImageData_Impl* image) { | 136 PPB_ImageData_Impl* image) { |
136 ImageDataAutoMapper mapper(image); | 137 ImageDataAutoMapper mapper(image); |
137 skia::PlatformCanvas* canvas = image->GetPlatformCanvas(); | 138 skia::PlatformCanvas* canvas = image->GetPlatformCanvas(); |
138 if (!canvas || !scrollbar_) | 139 if (!canvas || !scrollbar_) |
139 return PP_FALSE; | 140 return PP_FALSE; |
140 canvas->save(); | 141 canvas->save(); |
141 canvas->scale(scale(), scale()); | 142 canvas->scale(scale(), scale()); |
142 scrollbar_->paint(webkit_glue::ToWebCanvas(canvas), rect); | 143 scrollbar_->paint(canvas, rect); |
143 canvas->restore(); | 144 canvas->restore(); |
144 | 145 |
145 #if defined(OS_WIN) | 146 #if defined(OS_WIN) |
146 if (base::win::GetVersion() == base::win::VERSION_XP) | 147 if (base::win::GetVersion() == base::win::VERSION_XP) |
147 skia::MakeOpaque(canvas, rect.x(), rect.y(), rect.width(), rect.height()); | 148 skia::MakeOpaque(canvas, rect.x(), rect.y(), rect.width(), rect.height()); |
148 #endif | 149 #endif |
149 | 150 |
150 return PP_TRUE; | 151 return PP_TRUE; |
151 } | 152 } |
152 | 153 |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 pp_rect.point.x = dirty_.x(); | 242 pp_rect.point.x = dirty_.x(); |
242 pp_rect.point.y = dirty_.y(); | 243 pp_rect.point.y = dirty_.y(); |
243 pp_rect.size.width = dirty_.width(); | 244 pp_rect.size.width = dirty_.width(); |
244 pp_rect.size.height = dirty_.height(); | 245 pp_rect.size.height = dirty_.height(); |
245 dirty_ = gfx::Rect(); | 246 dirty_ = gfx::Rect(); |
246 Invalidate(&pp_rect); | 247 Invalidate(&pp_rect); |
247 } | 248 } |
248 | 249 |
249 } // namespace ppapi | 250 } // namespace ppapi |
250 } // namespace webkit | 251 } // namespace webkit |
OLD | NEW |