| 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/plugins/npapi/webplugin_delegate_impl.h" | 5 #include "webkit/plugins/npapi/webplugin_delegate_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include <gtk/gtk.h> | 10 #include <gtk/gtk.h> |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 plugin_->SetWindow(handle); | 103 plugin_->SetWindow(handle); |
| 104 return true; | 104 return true; |
| 105 } | 105 } |
| 106 | 106 |
| 107 void WebPluginDelegateImpl::PlatformDestroyInstance() { | 107 void WebPluginDelegateImpl::PlatformDestroyInstance() { |
| 108 // Nothing to do here. | 108 // Nothing to do here. |
| 109 } | 109 } |
| 110 | 110 |
| 111 void WebPluginDelegateImpl::Paint(WebKit::WebCanvas* canvas, | 111 void WebPluginDelegateImpl::Paint(WebKit::WebCanvas* canvas, |
| 112 const gfx::Rect& rect) { | 112 const gfx::Rect& rect) { |
| 113 if (!windowless_) | 113 if (!windowless_ || !skia::SupportsPlatformPaint(canvas)) |
| 114 return; | 114 return; |
| 115 skia::ScopedPlatformPaint scoped_platform_paint(canvas); | 115 skia::ScopedPlatformPaint scoped_platform_paint(canvas); |
| 116 cairo_t* context = scoped_platform_paint.GetPlatformSurface(); | 116 cairo_t* context = scoped_platform_paint.GetPlatformSurface(); |
| 117 WindowlessPaint(context, rect); | 117 WindowlessPaint(context, rect); |
| 118 } | 118 } |
| 119 | 119 |
| 120 bool WebPluginDelegateImpl::WindowedCreatePlugin() { | 120 bool WebPluginDelegateImpl::WindowedCreatePlugin() { |
| 121 DCHECK(!windowed_handle_); | 121 DCHECK(!windowed_handle_); |
| 122 DCHECK(!plug_); | 122 DCHECK(!plug_); |
| 123 | 123 |
| (...skipping 634 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 758 // as someone might be setting the cursor in the main process as well. | 758 // as someone might be setting the cursor in the main process as well. |
| 759 *cursor = current_windowless_cursor_; | 759 *cursor = current_windowless_cursor_; |
| 760 } | 760 } |
| 761 #endif | 761 #endif |
| 762 | 762 |
| 763 return ret; | 763 return ret; |
| 764 } | 764 } |
| 765 | 765 |
| 766 } // namespace npapi | 766 } // namespace npapi |
| 767 } // namespace webkit | 767 } // namespace webkit |
| OLD | NEW |