Commit 530a19be authored by qinmin@chromium.org's avatar qinmin@chromium.org

Revert pagescale from plugin placeholder

For impl-side painting, page scales are directly applied to cc.
As a result, we are no longer using old style css based page scale transforms.
Revert all the changes we made in https://codereview.chromium.org/11359200/ as this is no longer needed

BUG=175121

Review URL: https://codereview.chromium.org/12218122

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182076 0039d316-1c4b-4281-b951-d872f2087c98
parent e9a77a4a
......@@ -127,13 +127,6 @@ void WebViewPlugin::paint(WebCanvas* canvas, const WebRect& rect) {
paint_rect.Offset(-rect_.x(), -rect_.y());
float content_scale = 1.0f / GetPageScaleFactor();
paint_rect.SetRect(
ceil(content_scale * paint_rect.x()),
ceil(content_scale * paint_rect.y()),
ceil(content_scale * paint_rect.width()),
ceil(content_scale * paint_rect.height()));
canvas->translate(SkIntToScalar(rect_.x()), SkIntToScalar(rect_.y()));
canvas->save();
......@@ -147,13 +140,8 @@ void WebViewPlugin::paint(WebCanvas* canvas, const WebRect& rect) {
void WebViewPlugin::updateGeometry(
const WebRect& frame_rect, const WebRect& clip_rect,
const WebVector<WebRect>& cut_out_rects, bool is_visible) {
if (static_cast<gfx::Rect>(frame_rect) != rect_) {
if (static_cast<gfx::Rect>(frame_rect) != rect_)
rect_ = frame_rect;
float content_scale = 1.0f / GetPageScaleFactor();
web_view_->resize(WebSize(content_scale * frame_rect.width,
content_scale * frame_rect.height));
}
}
bool WebViewPlugin::acceptsInputEvents() {
......@@ -256,13 +244,4 @@ void WebViewPlugin::didReceiveResponse(WebFrame* frame,
WebFrameClient::didReceiveResponse(frame, identifier, response);
}
float WebViewPlugin::GetPageScaleFactor() {
if (container_) {
WebFrame* frame = container_->element().document().frame();
WebView* top_view = frame->top()->view();
return top_view->pageScaleFactor();
}
return 1.0f;
}
} // namespace webkit
......@@ -143,9 +143,6 @@ class WebViewPlugin: public WebKit::WebPlugin, public WebKit::WebViewClient,
friend class base::DeleteHelper<WebViewPlugin>;
virtual ~WebViewPlugin();
// Get the scale factor for the current page.
float GetPageScaleFactor();
Delegate* delegate_;
// Destroys itself.
WebKit::WebCursorInfo current_cursor_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment