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

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

Issue 2312393003: Update viewport_to_dip_scale on bound compositor host (Closed)
Patch Set: Created 4 years, 3 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 | « no previous file | 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 2322 matching lines...) Expand 10 before | Expand all | Expand 10 after
2333 2333
2334 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false); 2334 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false);
2335 PPB_Graphics3D_Impl* graphics_3d = 2335 PPB_Graphics3D_Impl* graphics_3d =
2336 enter_3d.succeeded() 2336 enter_3d.succeeded()
2337 ? static_cast<PPB_Graphics3D_Impl*>(enter_3d.object()) 2337 ? static_cast<PPB_Graphics3D_Impl*>(enter_3d.object())
2338 : NULL; 2338 : NULL;
2339 2339
2340 if (compositor) { 2340 if (compositor) {
2341 if (compositor->BindToInstance(this)) { 2341 if (compositor->BindToInstance(this)) {
2342 bound_compositor_ = compositor; 2342 bound_compositor_ = compositor;
2343 bound_compositor_->set_viewport_to_dip_scale(viewport_to_dip_scale_);
2343 UpdateLayer(true); 2344 UpdateLayer(true);
2344 return PP_TRUE; 2345 return PP_TRUE;
2345 } 2346 }
2346 } else if (graphics_2d) { 2347 } else if (graphics_2d) {
2347 if (graphics_2d->BindToInstance(this)) { 2348 if (graphics_2d->BindToInstance(this)) {
2348 bound_graphics_2d_platform_ = graphics_2d; 2349 bound_graphics_2d_platform_ = graphics_2d;
2350 bound_graphics_2d_platform_->set_viewport_to_dip_scale(
2351 viewport_to_dip_scale_);
2349 UpdateLayer(true); 2352 UpdateLayer(true);
2350 return PP_TRUE; 2353 return PP_TRUE;
2351 } 2354 }
2352 } else if (graphics_3d) { 2355 } else if (graphics_3d) {
2353 // Make sure graphics can only be bound to the instance it is 2356 // Make sure graphics can only be bound to the instance it is
2354 // associated with. 2357 // associated with.
2355 if (graphics_3d->pp_instance() == pp_instance() && 2358 if (graphics_3d->pp_instance() == pp_instance() &&
2356 graphics_3d->BindToInstance(true)) { 2359 graphics_3d->BindToInstance(true)) {
2357 bound_graphics_3d_ = graphics_3d; 2360 bound_graphics_3d_ = graphics_3d;
2358 UpdateLayer(true); 2361 UpdateLayer(true);
(...skipping 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
3421 const cc::TextureMailbox& mailbox) const { 3424 const cc::TextureMailbox& mailbox) const {
3422 auto it = 3425 auto it =
3423 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), 3426 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(),
3424 [&mailbox](const TextureMailboxRefCount& ref_count) { 3427 [&mailbox](const TextureMailboxRefCount& ref_count) {
3425 return ref_count.first.mailbox() == mailbox.mailbox(); 3428 return ref_count.first.mailbox() == mailbox.mailbox();
3426 }); 3429 });
3427 return it != texture_ref_counts_.end(); 3430 return it != texture_ref_counts_.end();
3428 } 3431 }
3429 3432
3430 } // namespace content 3433 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698