Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(836)

Side by Side Diff: content/renderer/pepper/pepper_plugin_instance_impl.cc

Issue 1964423003: Apply viewport to dip scale to Graphics2D, Compositor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/renderer/pepper/pepper_graphics_2d_host.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/renderer/pepper/pepper_plugin_instance_impl.h" 5 #include "content/renderer/pepper/pepper_plugin_instance_impl.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bit_cast.h" 10 #include "base/bit_cast.h"
(...skipping 1634 matching lines...) Expand 10 before | Expand all | Expand 10 after
1645 1645
1646 void PepperPluginInstanceImpl::SendDidChangeView() { 1646 void PepperPluginInstanceImpl::SendDidChangeView() {
1647 // An asynchronous view update is scheduled. Skip sending this update. 1647 // An asynchronous view update is scheduled. Skip sending this update.
1648 if (view_change_weak_ptr_factory_.HasWeakPtrs()) 1648 if (view_change_weak_ptr_factory_.HasWeakPtrs())
1649 return; 1649 return;
1650 1650
1651 // Don't send DidChangeView to crashed plugins. 1651 // Don't send DidChangeView to crashed plugins.
1652 if (module()->is_crashed()) 1652 if (module()->is_crashed())
1653 return; 1653 return;
1654 1654
1655 if (bound_compositor_)
1656 bound_compositor_->set_viewport_to_dip_scale(viewport_to_dip_scale_);
1657
1658 if (bound_graphics_2d_platform_)
1659 bound_graphics_2d_platform_->set_viewport_to_dip_scale(
1660 viewport_to_dip_scale_);
1661
1655 // During the first view update, initialize the throttler. 1662 // During the first view update, initialize the throttler.
1656 if (!sent_initial_did_change_view_) { 1663 if (!sent_initial_did_change_view_) {
1657 if (is_flash_plugin_ && RenderThread::Get()) { 1664 if (is_flash_plugin_ && RenderThread::Get()) {
1658 RenderThread::Get()->RecordAction( 1665 RenderThread::Get()->RecordAction(
1659 base::UserMetricsAction("Flash.PluginInstanceCreated")); 1666 base::UserMetricsAction("Flash.PluginInstanceCreated"));
1660 RecordFlashSizeMetric(unobscured_rect_.width(), 1667 RecordFlashSizeMetric(unobscured_rect_.width(),
1661 unobscured_rect_.height()); 1668 unobscured_rect_.height());
1662 } 1669 }
1663 1670
1664 if (throttler_) { 1671 if (throttler_) {
(...skipping 1675 matching lines...) Expand 10 before | Expand all | Expand 10 after
3340 } 3347 }
3341 3348
3342 void PepperPluginInstanceImpl::ConvertDIPToViewport(gfx::Rect* rect) const { 3349 void PepperPluginInstanceImpl::ConvertDIPToViewport(gfx::Rect* rect) const {
3343 rect->set_x(rect->x() / viewport_to_dip_scale_); 3350 rect->set_x(rect->x() / viewport_to_dip_scale_);
3344 rect->set_y(rect->y() / viewport_to_dip_scale_); 3351 rect->set_y(rect->y() / viewport_to_dip_scale_);
3345 rect->set_width(rect->width() / viewport_to_dip_scale_); 3352 rect->set_width(rect->width() / viewport_to_dip_scale_);
3346 rect->set_height(rect->height() / viewport_to_dip_scale_); 3353 rect->set_height(rect->height() / viewport_to_dip_scale_);
3347 } 3354 }
3348 3355
3349 } // namespace content 3356 } // namespace content
OLDNEW
« no previous file with comments | « content/renderer/pepper/pepper_graphics_2d_host.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698