diff options
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/app/chrome_dll.rc | 7 | ||||
-rw-r--r-- | chrome/app/chrome_dll_resource.h | 2 | ||||
-rw-r--r-- | chrome/renderer/renderer_resources.grd | 1 | ||||
-rw-r--r-- | chrome/renderer/resources/sadplugin.png (renamed from chrome/app/resources/sadplugin.png) | bin | 486 -> 486 bytes | |||
-rw-r--r-- | chrome/renderer/webplugin_delegate_proxy.cc | 25 |
5 files changed, 20 insertions, 15 deletions
diff --git a/chrome/app/chrome_dll.rc b/chrome/app/chrome_dll.rc index a88b0a2..f7c7657 100644 --- a/chrome/app/chrome_dll.rc +++ b/chrome/app/chrome_dll.rc @@ -178,13 +178,6 @@ IDR_MAINFRAME ICON "theme\chromium\chromium.ico" ///////////////////////////////////////////////////////////////////////////// // -// Bitmap -// - -IDR_SAD_PLUGIN BINDATA "resources\\sadplugin.png" - -///////////////////////////////////////////////////////////////////////////// -// // Dialog // diff --git a/chrome/app/chrome_dll_resource.h b/chrome/app/chrome_dll_resource.h index 8dda907..7e49536 100644 --- a/chrome/app/chrome_dll_resource.h +++ b/chrome/app/chrome_dll_resource.h @@ -8,8 +8,6 @@ #define IDR_MAINFRAME 101 -#define IDR_SAD_PLUGIN 1000 - // Values around 1600 are used by installer/setup/build/ #define IDD_IPC_SETTINGS 3000 diff --git a/chrome/renderer/renderer_resources.grd b/chrome/renderer/renderer_resources.grd index d16c963..241abb3 100644 --- a/chrome/renderer/renderer_resources.grd +++ b/chrome/renderer/renderer_resources.grd @@ -19,6 +19,7 @@ without changes to the corresponding grd file. mp6 --> <include name="IDR_JSON_SCHEMA_JS" file="resources\json_schema.js" type="BINDATA" /> <include name="IDR_NET_ERROR_HTML" file="resources\neterror.html" type="BINDATA" /> <include name="IDR_RENDERER_EXTENSION_BINDINGS_JS" file="resources\renderer_extension_bindings.js" type="BINDATA" /> + <include name="IDR_SAD_PLUGIN" file="resources\sadplugin.png" type="BINDATA" /> </includes> </release> </grit> diff --git a/chrome/app/resources/sadplugin.png b/chrome/renderer/resources/sadplugin.png Binary files differindex 906c3c6..906c3c6 100644 --- a/chrome/app/resources/sadplugin.png +++ b/chrome/renderer/resources/sadplugin.png diff --git a/chrome/renderer/webplugin_delegate_proxy.cc b/chrome/renderer/webplugin_delegate_proxy.cc index 8314b71..d2b7906 100644 --- a/chrome/renderer/webplugin_delegate_proxy.cc +++ b/chrome/renderer/webplugin_delegate_proxy.cc @@ -18,7 +18,6 @@ #include "base/string_util.h" #include "base/gfx/size.h" #include "base/gfx/native_widget_types.h" -#include "chrome/app/chrome_dll_resource.h" #include "chrome/common/child_process_logging.h" #include "chrome/common/plugin_messages.h" #include "chrome/common/render_messages.h" @@ -28,6 +27,7 @@ #include "chrome/renderer/render_thread.h" #include "chrome/renderer/render_view.h" #include "grit/generated_resources.h" +#include "grit/renderer_resources.h" #include "net/base/mime_util.h" #include "printing/native_metafile.h" #include "webkit/api/public/WebCursorInfo.h" @@ -855,7 +855,6 @@ void WebPluginDelegateProxy::OnGetCPBrowsingContext(uint32* context) { void WebPluginDelegateProxy::PaintSadPlugin(gfx::NativeDrawingContext hdc, const gfx::Rect& rect) { -#if defined(OS_WIN) const int width = plugin_rect_.width(); const int height = plugin_rect_.height(); @@ -878,11 +877,25 @@ void WebPluginDelegateProxy::PaintSadPlugin(gfx::NativeDrawingContext hdc, std::max(0, (height - sad_plugin_->height())/2)); } - canvas.getTopPlatformDevice().drawToHDC( - hdc, plugin_rect_.x(), plugin_rect_.y(), NULL); + skia::PlatformDevice& device = canvas.getTopPlatformDevice(); + +#if defined(OS_WIN) + device.drawToHDC(hdc, plugin_rect_.x(), plugin_rect_.y(), NULL); +#elif defined(OS_LINUX) + // Though conceptually we've been handed a cairo_surface_t* and we + // could've just hooked up the canvas to draw directly onto it, our + // canvas implementation currently uses cairo as a dumb pixel buffer + // and would have done the following copy anyway. + // TODO(evanm): revisit when we have printing hooked up, as that might + // change our usage of cairo. + cairo_t* cairo = cairo_create(hdc); + cairo_surface_t* source_surface = device.beginPlatformPaint(); + cairo_set_source_surface(cairo, source_surface, plugin_rect_.x(), plugin_rect_.y()); + cairo_paint(cairo); + cairo_destroy(cairo); + // We have no endPlatformPaint() on the Linux PlatformDevice. + // The surface is owned by the device. #else - // TODO(port): it ought to be possible to refactor this to be shared between - // platforms. It's just the final drawToHDC that kills us. NOTIMPLEMENTED(); #endif } |