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 "content/child/npapi/webplugin_delegate_impl.h" | 5 #include "content/child/npapi/webplugin_delegate_impl.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 #include <gdk/gdkx.h> | 8 #include <gdk/gdkx.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 gfx::PluginWindowHandle handle = | 88 gfx::PluginWindowHandle handle = |
89 windowless_ ? 0 : gtk_plug_get_id(GTK_PLUG(plug_)); | 89 windowless_ ? 0 : gtk_plug_get_id(GTK_PLUG(plug_)); |
90 plugin_->SetWindow(handle); | 90 plugin_->SetWindow(handle); |
91 return true; | 91 return true; |
92 } | 92 } |
93 | 93 |
94 void WebPluginDelegateImpl::PlatformDestroyInstance() { | 94 void WebPluginDelegateImpl::PlatformDestroyInstance() { |
95 // Nothing to do here. | 95 // Nothing to do here. |
96 } | 96 } |
97 | 97 |
98 void WebPluginDelegateImpl::Paint(WebKit::WebCanvas* canvas, | 98 void WebPluginDelegateImpl::Paint(SkCanvas* canvas, const gfx::Rect& rect) { |
99 const gfx::Rect& rect) { | |
100 if (!windowless_ || !skia::SupportsPlatformPaint(canvas)) | 99 if (!windowless_ || !skia::SupportsPlatformPaint(canvas)) |
101 return; | 100 return; |
102 skia::ScopedPlatformPaint scoped_platform_paint(canvas); | 101 skia::ScopedPlatformPaint scoped_platform_paint(canvas); |
103 cairo_t* context = scoped_platform_paint.GetPlatformSurface(); | 102 cairo_t* context = scoped_platform_paint.GetPlatformSurface(); |
104 WindowlessPaint(context, rect); | 103 WindowlessPaint(context, rect); |
105 } | 104 } |
106 | 105 |
107 bool WebPluginDelegateImpl::WindowedCreatePlugin() { | 106 bool WebPluginDelegateImpl::WindowedCreatePlugin() { |
108 DCHECK(!windowed_handle_); | 107 DCHECK(!windowed_handle_); |
109 DCHECK(!plug_); | 108 DCHECK(!plug_); |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
742 // it. There is a nasty race condition here with the multiprocess browser | 741 // it. There is a nasty race condition here with the multiprocess browser |
743 // as someone might be setting the cursor in the main process as well. | 742 // as someone might be setting the cursor in the main process as well. |
744 *cursor = current_windowless_cursor_; | 743 *cursor = current_windowless_cursor_; |
745 } | 744 } |
746 #endif | 745 #endif |
747 | 746 |
748 return ret; | 747 return ret; |
749 } | 748 } |
750 | 749 |
751 } // namespace content | 750 } // namespace content |
OLD | NEW |