summaryrefslogtreecommitdiffstats
path: root/webkit/glue/webframe_impl.cc
diff options
context:
space:
mode:
authorjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-12 17:35:28 +0000
committerjrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-05-12 17:35:28 +0000
commit0d0f0ac6478b619f8684ada49e8ef1b953bcefa2 (patch)
tree1068ca99838c4c8f0b5b7f4235ec1aac04c4b6c7 /webkit/glue/webframe_impl.cc
parentb1d836dfb359a1e38339859f5cbaba8451c3187b (diff)
downloadchromium_src-0d0f0ac6478b619f8684ada49e8ef1b953bcefa2.zip
chromium_src-0d0f0ac6478b619f8684ada49e8ef1b953bcefa2.tar.gz
chromium_src-0d0f0ac6478b619f8684ada49e8ef1b953bcefa2.tar.bz2
This change makes sure we always have a valid NSGraphicsContext, a job
normally done implicitly by Cocoa. This fixes the misspell underline problem. Briefly, this change allows any Cocoa rendering to work. I had hoped to (eventually) eliminate all Cocoa in Mac Chromium WebKit. (The Chromium renderer isn't really a Cocoa app, so it makes sense). However, that goal appears to diverge from Apple's goal of a single "Mac" port. Even if I can eliminate all Cocoa use, the long-term safe thing to do is to make sure any Cocoa drawing will "just work". The assumption is that it'll either show up randomly (and crash), or be difficult to get removed quickly (like the original misspell change). Review URL: http://codereview.chromium.org/114020 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@15866 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/glue/webframe_impl.cc')
-rw-r--r--webkit/glue/webframe_impl.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/webkit/glue/webframe_impl.cc b/webkit/glue/webframe_impl.cc
index db177aa..834f4a8 100644
--- a/webkit/glue/webframe_impl.cc
+++ b/webkit/glue/webframe_impl.cc
@@ -98,6 +98,9 @@ MSVC_PUSH_WARNING_LEVEL(0);
#include "HTMLNames.h"
#include "HistoryItem.h"
#include "InspectorController.h"
+#if defined(OS_MACOSX)
+#include "LocalCurrentGraphicsContext.h"
+#endif
#include "markup.h"
#include "Page.h"
#include "PlatformContextSkia.h"
@@ -1550,6 +1553,7 @@ void WebFrameImpl::Paint(skia::PlatformCanvas* canvas, const WebRect& rect) {
#if defined(OS_MACOSX)
CGContextRef context = canvas->getTopPlatformDevice().GetBitmapContext();
GraphicsContext gc(context);
+ WebCore::LocalCurrentGraphicsContext localContext(&gc);
#else
PlatformContextSkia context(canvas);