Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 Loading... | |
| 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 |
| OLD | NEW |