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/resource_creation_impl.h" | 5 #include "content/renderer/pepper/resource_creation_impl.h" |
| 6 | 6 |
| 7 #include "content/renderer/pepper/pepper_plugin_instance_impl.h" | |
| 8 #include "content/renderer/pepper/pepper_plugin_instance_throttler.h" | |
| 7 #include "content/renderer/pepper/ppb_audio_impl.h" | 9 #include "content/renderer/pepper/ppb_audio_impl.h" |
| 8 #include "content/renderer/pepper/ppb_broker_impl.h" | 10 #include "content/renderer/pepper/ppb_broker_impl.h" |
| 9 #include "content/renderer/pepper/ppb_buffer_impl.h" | 11 #include "content/renderer/pepper/ppb_buffer_impl.h" |
| 10 #include "content/renderer/pepper/ppb_flash_message_loop_impl.h" | 12 #include "content/renderer/pepper/ppb_flash_message_loop_impl.h" |
| 11 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" | 13 #include "content/renderer/pepper/ppb_graphics_3d_impl.h" |
| 12 #include "content/renderer/pepper/ppb_image_data_impl.h" | 14 #include "content/renderer/pepper/ppb_image_data_impl.h" |
| 13 #include "content/renderer/pepper/ppb_scrollbar_impl.h" | 15 #include "content/renderer/pepper/ppb_scrollbar_impl.h" |
| 14 #include "content/renderer/pepper/ppb_video_decoder_impl.h" | 16 #include "content/renderer/pepper/ppb_video_decoder_impl.h" |
| 15 #include "ppapi/c/pp_bool.h" | 17 #include "ppapi/c/pp_bool.h" |
| 16 #include "ppapi/c/pp_size.h" | 18 #include "ppapi/c/pp_size.h" |
| 17 #include "ppapi/c/pp_var.h" | 19 #include "ppapi/c/pp_var.h" |
| 18 #include "ppapi/shared_impl/ppb_audio_config_shared.h" | 20 #include "ppapi/shared_impl/ppb_audio_config_shared.h" |
| 19 #include "ppapi/shared_impl/ppb_audio_shared.h" | 21 #include "ppapi/shared_impl/ppb_audio_shared.h" |
| 20 #include "ppapi/shared_impl/ppb_image_data_shared.h" | 22 #include "ppapi/shared_impl/ppb_image_data_shared.h" |
| 21 #include "ppapi/shared_impl/ppb_input_event_shared.h" | 23 #include "ppapi/shared_impl/ppb_input_event_shared.h" |
| 22 #include "ppapi/shared_impl/var.h" | 24 #include "ppapi/shared_impl/var.h" |
| 23 | 25 |
| 24 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
| 25 #include "base/command_line.h" | 27 #include "base/command_line.h" |
| 26 #include "base/win/windows_version.h" | 28 #include "base/win/windows_version.h" |
| 27 #include "content/public/common/content_switches.h" | 29 #include "content/public/common/content_switches.h" |
| 28 #endif | 30 #endif |
| 29 | 31 |
| 30 using ppapi::InputEventData; | 32 using ppapi::InputEventData; |
| 31 using ppapi::PPB_InputEvent_Shared; | 33 using ppapi::PPB_InputEvent_Shared; |
| 32 using ppapi::StringVar; | 34 using ppapi::StringVar; |
| 33 | 35 |
| 34 namespace content { | 36 namespace content { |
| 35 | 37 |
| 36 ResourceCreationImpl::ResourceCreationImpl(PepperPluginInstanceImpl* instance) { | 38 ResourceCreationImpl::ResourceCreationImpl(PepperPluginInstanceImpl* instance) |
| 39 : instance_(instance) { | |
| 37 } | 40 } |
| 38 | 41 |
| 39 ResourceCreationImpl::~ResourceCreationImpl() {} | 42 ResourceCreationImpl::~ResourceCreationImpl() {} |
| 40 | 43 |
| 41 PP_Resource ResourceCreationImpl::CreateAudio1_0( | 44 PP_Resource ResourceCreationImpl::CreateAudio1_0( |
| 42 PP_Instance instance, | 45 PP_Instance instance, |
| 43 PP_Resource config_id, | 46 PP_Resource config_id, |
| 44 PPB_Audio_Callback_1_0 audio_callback, | 47 PPB_Audio_Callback_1_0 audio_callback, |
| 45 void* user_data) { | 48 void* user_data) { |
| 46 return 0; // Not supported in-process. | 49 return 0; // Not supported in-process. |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 99 return 0; // Not supported in-process. | 102 return 0; // Not supported in-process. |
| 100 } | 103 } |
| 101 | 104 |
| 102 PP_Resource ResourceCreationImpl::CreateFlashMessageLoop(PP_Instance instance) { | 105 PP_Resource ResourceCreationImpl::CreateFlashMessageLoop(PP_Instance instance) { |
| 103 return PPB_Flash_MessageLoop_Impl::Create(instance); | 106 return PPB_Flash_MessageLoop_Impl::Create(instance); |
| 104 } | 107 } |
| 105 | 108 |
| 106 PP_Resource ResourceCreationImpl::CreateGraphics3D(PP_Instance instance, | 109 PP_Resource ResourceCreationImpl::CreateGraphics3D(PP_Instance instance, |
| 107 PP_Resource share_context, | 110 PP_Resource share_context, |
| 108 const int32_t* attrib_list) { | 111 const int32_t* attrib_list) { |
| 112 // Force SW rendering for keyframe extraction to avoid pixel reads from VRAM. | |
|
groby-ooo-7-16
2014/11/14 22:45:39
I'm curious: ResourceCreationImpl has essentially
piman
2014/11/14 22:53:00
Yes, this logic should go to PPB_Graphics3D_Impl::
tommycli
2014/11/14 23:58:21
Done.
tommycli
2014/11/14 23:58:21
Done.
| |
| 113 if (instance_->throttler() && instance_->throttler()->needs_snapshot()) | |
| 114 return 0; | |
| 115 | |
| 109 return PPB_Graphics3D_Impl::Create(instance, share_context, attrib_list); | 116 return PPB_Graphics3D_Impl::Create(instance, share_context, attrib_list); |
| 110 } | 117 } |
| 111 | 118 |
| 112 PP_Resource ResourceCreationImpl::CreateGraphics3DRaw( | 119 PP_Resource ResourceCreationImpl::CreateGraphics3DRaw( |
| 113 PP_Instance instance, | 120 PP_Instance instance, |
| 114 PP_Resource share_context, | 121 PP_Resource share_context, |
| 115 const int32_t* attrib_list, | 122 const int32_t* attrib_list, |
| 116 gpu::Capabilities* capabilities, | 123 gpu::Capabilities* capabilities, |
| 117 base::SharedMemoryHandle* shared_state) { | 124 base::SharedMemoryHandle* shared_state) { |
| 125 // Force SW rendering for keyframe extraction to avoid pixel reads from VRAM. | |
| 126 if (instance_->throttler() && instance_->throttler()->needs_snapshot()) | |
| 127 return 0; | |
| 128 | |
| 118 return PPB_Graphics3D_Impl::CreateRaw(instance, share_context, attrib_list, | 129 return PPB_Graphics3D_Impl::CreateRaw(instance, share_context, attrib_list, |
| 119 capabilities, shared_state); | 130 capabilities, shared_state); |
| 120 } | 131 } |
| 121 | 132 |
| 122 PP_Resource ResourceCreationImpl::CreateHostResolver(PP_Instance instance) { | 133 PP_Resource ResourceCreationImpl::CreateHostResolver(PP_Instance instance) { |
| 123 return 0; // Not supported in-process. | 134 return 0; // Not supported in-process. |
| 124 } | 135 } |
| 125 | 136 |
| 126 PP_Resource ResourceCreationImpl::CreateHostResolverPrivate( | 137 PP_Resource ResourceCreationImpl::CreateHostResolverPrivate( |
| 127 PP_Instance instance) { | 138 PP_Instance instance) { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 360 wheel_ticks, | 371 wheel_ticks, |
| 361 scroll_by_page); | 372 scroll_by_page); |
| 362 } | 373 } |
| 363 | 374 |
| 364 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( | 375 PP_Resource ResourceCreationImpl::CreateX509CertificatePrivate( |
| 365 PP_Instance instance) { | 376 PP_Instance instance) { |
| 366 return 0; // Not supported in-process. | 377 return 0; // Not supported in-process. |
| 367 } | 378 } |
| 368 | 379 |
| 369 } // namespace content | 380 } // namespace content |
| OLD | NEW |