diff options
Diffstat (limited to 'ppapi/cpp/dev')
-rw-r--r-- | ppapi/cpp/dev/graphics_3d_client_dev.cc | 43 | ||||
-rw-r--r-- | ppapi/cpp/dev/graphics_3d_client_dev.h | 36 | ||||
-rw-r--r-- | ppapi/cpp/dev/graphics_3d_dev.cc | 76 | ||||
-rw-r--r-- | ppapi/cpp/dev/graphics_3d_dev.h | 39 | ||||
-rw-r--r-- | ppapi/cpp/dev/video_decoder_dev.cc | 4 | ||||
-rw-r--r-- | ppapi/cpp/dev/video_decoder_dev.h | 4 |
6 files changed, 4 insertions, 198 deletions
diff --git a/ppapi/cpp/dev/graphics_3d_client_dev.cc b/ppapi/cpp/dev/graphics_3d_client_dev.cc deleted file mode 100644 index bdd2e7e..0000000 --- a/ppapi/cpp/dev/graphics_3d_client_dev.cc +++ /dev/null @@ -1,43 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/cpp/dev/graphics_3d_client_dev.h" - -#include "ppapi/c/dev/ppp_graphics_3d_dev.h" -#include "ppapi/cpp/instance.h" -#include "ppapi/cpp/module.h" -#include "ppapi/cpp/module_impl.h" - -namespace pp { - -namespace { - -const char kPPPGraphics3DInterface[] = PPP_GRAPHICS_3D_DEV_INTERFACE; - -void Graphics3D_ContextLost(PP_Instance instance) { - void* object = - pp::Instance::GetPerInstanceObject(instance, kPPPGraphics3DInterface); - if (!object) - return; - return static_cast<Graphics3DClient_Dev*>(object)->Graphics3DContextLost(); -} - -static PPP_Graphics3D_Dev graphics3d_interface = { - &Graphics3D_ContextLost, -}; - -} // namespace - -Graphics3DClient_Dev::Graphics3DClient_Dev(Instance* instance) - : associated_instance_(instance) { - pp::Module::Get()->AddPluginInterface(kPPPGraphics3DInterface, - &graphics3d_interface); - associated_instance_->AddPerInstanceObject(kPPPGraphics3DInterface, this); -} - -Graphics3DClient_Dev::~Graphics3DClient_Dev() { - associated_instance_->RemovePerInstanceObject(kPPPGraphics3DInterface, this); -} - -} // namespace pp diff --git a/ppapi/cpp/dev/graphics_3d_client_dev.h b/ppapi/cpp/dev/graphics_3d_client_dev.h deleted file mode 100644 index 5f68fb2..0000000 --- a/ppapi/cpp/dev/graphics_3d_client_dev.h +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_CPP_DEV_GRAPHICS_3D_CLIENT_DEV_H_ -#define PPAPI_CPP_DEV_GRAPHICS_3D_CLIENT_DEV_H_ - -#include "ppapi/c/pp_stdint.h" - -namespace pp { - -class Instance; -class Rect; -class Scrollbar_Dev; -class Widget_Dev; - -// This class provides a C++ interface for callbacks related to 3D. You -// would normally use multiple inheritance to derive from this class in your -// instance. -class Graphics3DClient_Dev { - public: - Graphics3DClient_Dev(Instance* instance); - virtual ~Graphics3DClient_Dev(); - - /** - * Notification that the context was lost for the 3D devices. - */ - virtual void Graphics3DContextLost() = 0; - - private: - Instance* associated_instance_; -}; - -} // namespace pp - -#endif // PPAPI_CPP_DEV_GRAPHICS_3D_CLIENT_DEV_H_ diff --git a/ppapi/cpp/dev/graphics_3d_dev.cc b/ppapi/cpp/dev/graphics_3d_dev.cc deleted file mode 100644 index 953b859..0000000 --- a/ppapi/cpp/dev/graphics_3d_dev.cc +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ppapi/cpp/dev/graphics_3d_dev.h" - -#include "ppapi/c/pp_errors.h" -#include "ppapi/cpp/completion_callback.h" -#include "ppapi/cpp/instance.h" -#include "ppapi/cpp/module_impl.h" -#include "ppapi/cpp/var.h" - -namespace pp { - -namespace { - -template <> const char* interface_name<PPB_Graphics3D_Dev>() { - return PPB_GRAPHICS_3D_DEV_INTERFACE; -} - -} // namespace - -Graphics3D_Dev::Graphics3D_Dev() { -} - -Graphics3D_Dev::Graphics3D_Dev(const Instance& instance, - const Graphics3D_Dev& share_context, - const int32_t* attrib_list) { - if (has_interface<PPB_Graphics3D_Dev>()) { - PassRefFromConstructor(get_interface<PPB_Graphics3D_Dev>()->Create( - instance.pp_instance(), - share_context.pp_resource(), - attrib_list)); - } -} - -Graphics3D_Dev::~Graphics3D_Dev() { -} - -int32_t Graphics3D_Dev::GetAttribs(int32_t* attrib_list) const { - if (!has_interface<PPB_Graphics3D_Dev>()) - return PP_ERROR_NOINTERFACE; - - return get_interface<PPB_Graphics3D_Dev>()->GetAttribs( - pp_resource(), - attrib_list); -} - -int32_t Graphics3D_Dev::SetAttribs(int32_t* attrib_list) { - if (!has_interface<PPB_Graphics3D_Dev>()) - return PP_ERROR_NOINTERFACE; - - return get_interface<PPB_Graphics3D_Dev>()->SetAttribs( - pp_resource(), - attrib_list); -} - -int32_t Graphics3D_Dev::ResizeBuffers(int32_t width, int32_t height) { - if (!has_interface<PPB_Graphics3D_Dev>()) - return PP_ERROR_NOINTERFACE; - - return get_interface<PPB_Graphics3D_Dev>()->ResizeBuffers( - pp_resource(), width, height); -} - -int32_t Graphics3D_Dev::SwapBuffers(const CompletionCallback& cc) { - if (!has_interface<PPB_Graphics3D_Dev>()) - return PP_ERROR_NOINTERFACE; - - return get_interface<PPB_Graphics3D_Dev>()->SwapBuffers( - pp_resource(), - cc.pp_completion_callback()); -} - -} // namespace pp - diff --git a/ppapi/cpp/dev/graphics_3d_dev.h b/ppapi/cpp/dev/graphics_3d_dev.h deleted file mode 100644 index 30a46e7..0000000 --- a/ppapi/cpp/dev/graphics_3d_dev.h +++ /dev/null @@ -1,39 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#ifndef PPAPI_CPP_DEV_GRAPHICS_3D_DEV_H_ -#define PPAPI_CPP_DEV_GRAPHICS_3D_DEV_H_ - -#include "ppapi/c/dev/ppb_graphics_3d_dev.h" -#include "ppapi/cpp/resource.h" - -namespace pp { - -class CompletionCallback; -class Instance; -class Var; - -class Graphics3D_Dev : public Resource { - public: - // Creates an is_null() Graphics3D_Dev object. - Graphics3D_Dev(); - - Graphics3D_Dev(const Instance& instance, - const Graphics3D_Dev& share_context, - const int32_t* attrib_list); - - ~Graphics3D_Dev(); - - int32_t GetAttribs(int32_t* attrib_list) const; - int32_t SetAttribs(int32_t* attrib_list); - - int32_t ResizeBuffers(int32_t width, int32_t height); - - int32_t SwapBuffers(const CompletionCallback& cc); -}; - -} // namespace pp - -#endif // PPAPI_CPP_DEV_GRAPHICS_3D_DEV_H_ - diff --git a/ppapi/cpp/dev/video_decoder_dev.cc b/ppapi/cpp/dev/video_decoder_dev.cc index f7ab651..991ad55 100644 --- a/ppapi/cpp/dev/video_decoder_dev.cc +++ b/ppapi/cpp/dev/video_decoder_dev.cc @@ -8,7 +8,7 @@ #include "ppapi/c/dev/ppp_video_decoder_dev.h" #include "ppapi/c/pp_errors.h" #include "ppapi/cpp/dev/context_3d_dev.h" -#include "ppapi/cpp/dev/graphics_3d_dev.h" +#include "ppapi/cpp/graphics_3d.h" #include "ppapi/cpp/instance.h" #include "ppapi/cpp/module.h" #include "ppapi/cpp/module_impl.h" @@ -33,7 +33,7 @@ VideoDecoder_Dev::VideoDecoder_Dev(const Instance* instance, } VideoDecoder_Dev::VideoDecoder_Dev(const Instance* instance, - const Graphics3D_Dev& context, + const Graphics3D& context, PP_VideoDecoder_Profile profile) { if (!has_interface<PPB_VideoDecoder_Dev>()) return; diff --git a/ppapi/cpp/dev/video_decoder_dev.h b/ppapi/cpp/dev/video_decoder_dev.h index e260050..b761ef1 100644 --- a/ppapi/cpp/dev/video_decoder_dev.h +++ b/ppapi/cpp/dev/video_decoder_dev.h @@ -15,7 +15,7 @@ namespace pp { class Context3D_Dev; -class Graphics3D_Dev; +class Graphics3D; class Instance; // C++ wrapper for the Pepper Video Decoder interface. For more detailed @@ -29,7 +29,7 @@ class VideoDecoder_Dev : public Resource { const Context3D_Dev& context, PP_VideoDecoder_Profile profile); VideoDecoder_Dev(const Instance* instance, - const Graphics3D_Dev& context, + const Graphics3D& context, PP_VideoDecoder_Profile profile); explicit VideoDecoder_Dev(PP_Resource resource); |