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

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

Issue 2262323002: Update viewport_to_dip_scale on bound compositor host (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 2331 matching lines...) Expand 10 before | Expand all | Expand 10 after
2342 } 2342 }
2343 } 2343 }
2344 2344
2345 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false); 2345 EnterResourceNoLock<PPB_Graphics3D_API> enter_3d(device, false);
2346 PPB_Graphics3D_Impl* graphics_3d = 2346 PPB_Graphics3D_Impl* graphics_3d =
2347 enter_3d.succeeded() 2347 enter_3d.succeeded()
2348 ? static_cast<PPB_Graphics3D_Impl*>(enter_3d.object()) 2348 ? static_cast<PPB_Graphics3D_Impl*>(enter_3d.object())
2349 : NULL; 2349 : NULL;
2350 2350
2351 if (compositor) { 2351 if (compositor) {
2352 if (compositor->BindToInstance(this)) { 2352 if (compositor->BindToInstance(this)) {
oshima 2016/08/23 22:25:49 +bbudge@ (owner) I feel it's better to do this in
bbudge 2016/08/23 23:32:39 I might not understand the comment, but this seems
2353 bound_compositor_ = compositor; 2353 bound_compositor_ = compositor;
2354 bound_compositor_->set_viewport_to_dip_scale(viewport_to_dip_scale_);
2354 UpdateLayer(true); 2355 UpdateLayer(true);
2355 return PP_TRUE; 2356 return PP_TRUE;
2356 } 2357 }
2357 } else if (graphics_2d) { 2358 } else if (graphics_2d) {
2358 if (graphics_2d->BindToInstance(this)) { 2359 if (graphics_2d->BindToInstance(this)) {
2359 bound_graphics_2d_platform_ = graphics_2d; 2360 bound_graphics_2d_platform_ = graphics_2d;
2361 bound_graphics_2d_platform_->set_viewport_to_dip_scale(
2362 viewport_to_dip_scale_);
2360 UpdateLayer(true); 2363 UpdateLayer(true);
2361 return PP_TRUE; 2364 return PP_TRUE;
2362 } 2365 }
2363 } else if (graphics_3d) { 2366 } else if (graphics_3d) {
2364 // Make sure graphics can only be bound to the instance it is 2367 // Make sure graphics can only be bound to the instance it is
2365 // associated with. 2368 // associated with.
2366 if (graphics_3d->pp_instance() == pp_instance() && 2369 if (graphics_3d->pp_instance() == pp_instance() &&
2367 graphics_3d->BindToInstance(true)) { 2370 graphics_3d->BindToInstance(true)) {
2368 bound_graphics_3d_ = graphics_3d; 2371 bound_graphics_3d_ = graphics_3d;
2369 UpdateLayer(true); 2372 UpdateLayer(true);
(...skipping 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after
3442 const cc::TextureMailbox& mailbox) const { 3445 const cc::TextureMailbox& mailbox) const {
3443 auto it = 3446 auto it =
3444 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(), 3447 std::find_if(texture_ref_counts_.begin(), texture_ref_counts_.end(),
3445 [&mailbox](const TextureMailboxRefCount& ref_count) { 3448 [&mailbox](const TextureMailboxRefCount& ref_count) {
3446 return ref_count.first.mailbox() == mailbox.mailbox(); 3449 return ref_count.first.mailbox() == mailbox.mailbox();
3447 }); 3450 });
3448 return it != texture_ref_counts_.end(); 3451 return it != texture_ref_counts_.end();
3449 } 3452 }
3450 3453
3451 } // namespace content 3454 } // 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