| Index: content/renderer/pepper/ppb_graphics_3d_impl.cc
|
| diff --git a/content/renderer/pepper/ppb_graphics_3d_impl.cc b/content/renderer/pepper/ppb_graphics_3d_impl.cc
|
| index 3ad09d4eee47c9462d90f3def0fbf6beee360f35..1460bf0129f942ad92ed7d492989ee9b685ae145 100644
|
| --- a/content/renderer/pepper/ppb_graphics_3d_impl.cc
|
| +++ b/content/renderer/pepper/ppb_graphics_3d_impl.cc
|
| @@ -44,12 +44,9 @@ PPB_Graphics3D_Impl::PPB_Graphics3D_Impl(PP_Instance instance)
|
| : PPB_Graphics3D_Shared(instance),
|
| bound_to_instance_(false),
|
| commit_pending_(false),
|
| - weak_ptr_factory_(this) {
|
| -}
|
| + weak_ptr_factory_(this) {}
|
|
|
| -PPB_Graphics3D_Impl::~PPB_Graphics3D_Impl() {
|
| - DestroyGLES2Impl();
|
| -}
|
| +PPB_Graphics3D_Impl::~PPB_Graphics3D_Impl() { DestroyGLES2Impl(); }
|
|
|
| // static
|
| PP_Resource PPB_Graphics3D_Impl::Create(PP_Instance instance,
|
| @@ -135,9 +132,7 @@ bool PPB_Graphics3D_Impl::BindToInstance(bool bind) {
|
| return true;
|
| }
|
|
|
| -bool PPB_Graphics3D_Impl::IsOpaque() {
|
| - return platform_context_->IsOpaque();
|
| -}
|
| +bool PPB_Graphics3D_Impl::IsOpaque() { return platform_context_->IsOpaque(); }
|
|
|
| void PPB_Graphics3D_Impl::ViewInitiatedPaint() {
|
| commit_pending_ = false;
|
| @@ -146,8 +141,7 @@ void PPB_Graphics3D_Impl::ViewInitiatedPaint() {
|
| SwapBuffersACK(PP_OK);
|
| }
|
|
|
| -void PPB_Graphics3D_Impl::ViewFlushedPaint() {
|
| -}
|
| +void PPB_Graphics3D_Impl::ViewFlushedPaint() {}
|
|
|
| gpu::CommandBuffer* PPB_Graphics3D_Impl::GetCommandBuffer() {
|
| return platform_context_->GetCommandBuffer();
|
| @@ -184,7 +178,6 @@ int32 PPB_Graphics3D_Impl::DoSwapBuffers() {
|
| weak_ptr_factory_.GetWeakPtr()));
|
| }
|
|
|
| -
|
| return PP_OK_COMPLETIONPENDING;
|
| }
|
|
|
| @@ -203,8 +196,7 @@ bool PPB_Graphics3D_Impl::Init(PPB_Graphics3D_API* share_context,
|
| static_cast<PPB_Graphics3D_Shared*>(share_context)->gles2_impl();
|
| }
|
|
|
| - return CreateGLES2Impl(kCommandBufferSize, kTransferBufferSize,
|
| - share_gles2);
|
| + return CreateGLES2Impl(kCommandBufferSize, kTransferBufferSize, share_gles2);
|
| }
|
|
|
| bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context,
|
| @@ -214,8 +206,9 @@ bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context,
|
| if (!plugin_instance)
|
| return false;
|
|
|
| - const WebPreferences& prefs = static_cast<RenderViewImpl*>(plugin_instance->
|
| - GetRenderView())->webkit_preferences();
|
| + const WebPreferences& prefs =
|
| + static_cast<RenderViewImpl*>(plugin_instance->GetRenderView())
|
| + ->webkit_preferences();
|
| // 3D access might be disabled or blacklisted.
|
| if (!prefs.pepper_3d_enabled)
|
| return false;
|
| @@ -239,18 +232,15 @@ bool PPB_Graphics3D_Impl::InitRaw(PPB_Graphics3D_API* share_context,
|
| if (!platform_context_->Init(attrib_list, share_platform_context))
|
| return false;
|
|
|
| - platform_context_->SetContextLostCallback(
|
| - base::Bind(&PPB_Graphics3D_Impl::OnContextLost,
|
| - weak_ptr_factory_.GetWeakPtr()));
|
| + platform_context_->SetContextLostCallback(base::Bind(
|
| + &PPB_Graphics3D_Impl::OnContextLost, weak_ptr_factory_.GetWeakPtr()));
|
|
|
| - platform_context_->SetOnConsoleMessageCallback(
|
| - base::Bind(&PPB_Graphics3D_Impl::OnConsoleMessage,
|
| - weak_ptr_factory_.GetWeakPtr()));
|
| + platform_context_->SetOnConsoleMessageCallback(base::Bind(
|
| + &PPB_Graphics3D_Impl::OnConsoleMessage, weak_ptr_factory_.GetWeakPtr()));
|
| return true;
|
| }
|
|
|
| -void PPB_Graphics3D_Impl::OnConsoleMessage(const std::string& message,
|
| - int id) {
|
| +void PPB_Graphics3D_Impl::OnConsoleMessage(const std::string& message, int id) {
|
| if (!bound_to_instance_)
|
| return;
|
| WebPluginContainer* container =
|
| @@ -278,8 +268,8 @@ void PPB_Graphics3D_Impl::OnContextLost() {
|
| // Don't need to check for NULL from GetPluginInstance since when we're
|
| // bound, we know our instance is valid.
|
| if (bound_to_instance_) {
|
| - HostGlobals::Get()->GetInstance(pp_instance())->BindGraphics(
|
| - pp_instance(), 0);
|
| + HostGlobals::Get()->GetInstance(pp_instance())->BindGraphics(pp_instance(),
|
| + 0);
|
| }
|
|
|
| // Send context lost to plugin. This may have been caused by a PPAPI call, so
|
| @@ -304,10 +294,8 @@ void PPB_Graphics3D_Impl::SendContextLost() {
|
| // send the Graphics3DContextLost to the plugin; the instance may care about
|
| // that event even though this context has been destroyed.
|
| PP_Instance this_pp_instance = pp_instance();
|
| - const PPP_Graphics3D* ppp_graphics_3d =
|
| - static_cast<const PPP_Graphics3D*>(
|
| - instance->module()->GetPluginInterface(
|
| - PPP_GRAPHICS_3D_INTERFACE));
|
| + const PPP_Graphics3D* ppp_graphics_3d = static_cast<const PPP_Graphics3D*>(
|
| + instance->module()->GetPluginInterface(PPP_GRAPHICS_3D_INTERFACE));
|
| // We have to check *again* that the instance exists, because it could have
|
| // been deleted during GetPluginInterface(). Even the PluginModule could be
|
| // deleted, but in that case, the instance should also be gone, so the
|
|
|