diff options
author | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-08 17:36:26 +0000 |
---|---|---|
committer | alokp@chromium.org <alokp@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-08 17:36:26 +0000 |
commit | afc4ce91f94bc0cb976884e1c1c785a9e75f127a (patch) | |
tree | 0c64c063fe026abd1f2a81a97fe04b9dfd514702 /webkit/plugins/npapi | |
parent | 73689e53255c6ac22a90b0cd01fe40180ec2bbba (diff) | |
download | chromium_src-afc4ce91f94bc0cb976884e1c1c785a9e75f127a.zip chromium_src-afc4ce91f94bc0cb976884e1c1c785a9e75f127a.tar.gz chromium_src-afc4ce91f94bc0cb976884e1c1c785a9e75f127a.tar.bz2 |
Eliminate skia::PlatformCanvas, a subclass of SkCanvas. Skia provides multiple types of SkCanvas classes that we would like to use. Unfortunately these classes are implemented as subclasses of SkCanvas. Subclassing SkCanvas in both Skia and Chromium makes it impossible to dynamically use any SkCanvas. There is also no reason for chromium to subclass SkCanvas. Most of the extra functionalities can be implemented by hanging meta-data from SkCanvas.
We cannot eliminate skia::PlatformCanvas in one step due to WebKit's dependency on skia::PlatformCanvas. WebKit::WebCanvas is typedef as skia::PlatformDevice. It should be SkCanvas. So we need to do it in multiple steps:
1. Prepare Chromium tree for the change in WebKit::WebCanvas tyepdef. This basically means adding a couple of static_cast<skia::PlatformCanvas>(WebCanvas).
2. Change WebKit::WebCanvas typedef from skia::PlatformCanvas to SkCanvas
3. Eliminate skia::PlatformCanvas in chromium
This CL accomplishes the first step on windows.
WebKit BUG=https://bugs.webkit.org/show_bug.cgi?id=57563
Review URL: http://codereview.chromium.org/6783023
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80955 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit/plugins/npapi')
-rw-r--r-- | webkit/plugins/npapi/webplugin_delegate_impl_win.cc | 6 | ||||
-rw-r--r-- | webkit/plugins/npapi/webview_plugin.cc | 10 |
2 files changed, 7 insertions, 9 deletions
diff --git a/webkit/plugins/npapi/webplugin_delegate_impl_win.cc b/webkit/plugins/npapi/webplugin_delegate_impl_win.cc index 9845d2b..ff9c468 100644 --- a/webkit/plugins/npapi/webplugin_delegate_impl_win.cc +++ b/webkit/plugins/npapi/webplugin_delegate_impl_win.cc @@ -462,12 +462,12 @@ void WebPluginDelegateImpl::PlatformDestroyInstance() { } } -void WebPluginDelegateImpl::Paint(skia::PlatformCanvas* canvas, +void WebPluginDelegateImpl::Paint(WebKit::WebCanvas* canvas, const gfx::Rect& rect) { if (windowless_) { - HDC hdc = canvas->beginPlatformPaint(); + HDC hdc = skia::BeginPlatformPaint(canvas); WindowlessPaint(hdc, rect); - canvas->endPlatformPaint(); + skia::EndPlatformPaint(canvas); } } diff --git a/webkit/plugins/npapi/webview_plugin.cc b/webkit/plugins/npapi/webview_plugin.cc index a67a38b..d1df40f 100644 --- a/webkit/plugins/npapi/webview_plugin.cc +++ b/webkit/plugins/npapi/webview_plugin.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -128,17 +128,15 @@ void WebViewPlugin::paint(WebCanvas* canvas, const WebRect& rect) { CGContextTranslateCTM(context, rect_.x(), rect_.y()); CGContextSaveGState(context); #elif WEBKIT_USING_SKIA - skia::PlatformCanvas* platform_canvas = canvas; - platform_canvas->translate(SkIntToScalar(rect_.x()), - SkIntToScalar(rect_.y())); - platform_canvas->save(); + canvas->translate(SkIntToScalar(rect_.x()), SkIntToScalar(rect_.y())); + canvas->save(); #endif web_view_->layout(); web_view_->paint(canvas, paintRect); #if WEBKIT_USING_SKIA - platform_canvas->restore(); + canvas->restore(); #elif WEBKIT_USING_CG CGContextRestoreGState(context); #endif |