diff options
author | nfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-06 23:36:26 +0000 |
---|---|---|
committer | nfullagar@google.com <nfullagar@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-06 23:36:26 +0000 |
commit | 24efa80adcf956b606bdda62091357510894e5cf (patch) | |
tree | e9b63f7e520bd38592f5de2e27e4ca67af8f8f3b /ppapi/cpp | |
parent | 844cf21c267a04f519386c2753780531f0dc9214 (diff) | |
download | chromium_src-24efa80adcf956b606bdda62091357510894e5cf.zip chromium_src-24efa80adcf956b606bdda62091357510894e5cf.tar.gz chromium_src-24efa80adcf956b606bdda62091357510894e5cf.tar.bz2 |
Revert 99855 - Move PPAPI graphics3d and opengles interfaces out of Dev.
BUG= http://code.google.com/p/chromium/issues/detail?id=94320
TEST= various nacl exmaples, try bots
Review URL: http://codereview.chromium.org/7737013
TBR=nfullagar@google.com
Review URL: http://codereview.chromium.org/7782020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@99861 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/cpp')
-rw-r--r-- | ppapi/cpp/dev/graphics_3d_client_dev.cc (renamed from ppapi/cpp/graphics_3d_client.cc) | 16 | ||||
-rw-r--r-- | ppapi/cpp/dev/graphics_3d_client_dev.h (renamed from ppapi/cpp/graphics_3d_client.h) | 14 | ||||
-rw-r--r-- | ppapi/cpp/dev/graphics_3d_dev.cc | 76 | ||||
-rw-r--r-- | ppapi/cpp/dev/graphics_3d_dev.h (renamed from ppapi/cpp/graphics_3d.h) | 20 | ||||
-rw-r--r-- | ppapi/cpp/dev/video_decoder_dev.cc | 4 | ||||
-rw-r--r-- | ppapi/cpp/dev/video_decoder_dev.h | 4 | ||||
-rw-r--r-- | ppapi/cpp/graphics_3d.cc | 76 | ||||
-rw-r--r-- | ppapi/cpp/instance.cc | 4 | ||||
-rw-r--r-- | ppapi/cpp/instance.h | 6 |
9 files changed, 110 insertions, 110 deletions
diff --git a/ppapi/cpp/graphics_3d_client.cc b/ppapi/cpp/dev/graphics_3d_client_dev.cc index d827f9d..bdd2e7e 100644 --- a/ppapi/cpp/graphics_3d_client.cc +++ b/ppapi/cpp/dev/graphics_3d_client_dev.cc @@ -1,10 +1,10 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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/graphics_3d_client.h" +#include "ppapi/cpp/dev/graphics_3d_client_dev.h" -#include "ppapi/c/ppp_graphics_3d.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" @@ -13,30 +13,30 @@ namespace pp { namespace { -const char kPPPGraphics3DInterface[] = PPP_GRAPHICS_3D_INTERFACE; +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*>(object)->Graphics3DContextLost(); + return static_cast<Graphics3DClient_Dev*>(object)->Graphics3DContextLost(); } -static PPP_Graphics3D graphics3d_interface = { +static PPP_Graphics3D_Dev graphics3d_interface = { &Graphics3D_ContextLost, }; } // namespace -Graphics3DClient::Graphics3DClient(Instance* instance) +Graphics3DClient_Dev::Graphics3DClient_Dev(Instance* instance) : associated_instance_(instance) { pp::Module::Get()->AddPluginInterface(kPPPGraphics3DInterface, &graphics3d_interface); associated_instance_->AddPerInstanceObject(kPPPGraphics3DInterface, this); } -Graphics3DClient::~Graphics3DClient() { +Graphics3DClient_Dev::~Graphics3DClient_Dev() { associated_instance_->RemovePerInstanceObject(kPPPGraphics3DInterface, this); } diff --git a/ppapi/cpp/graphics_3d_client.h b/ppapi/cpp/dev/graphics_3d_client_dev.h index 511ca2d..5f68fb2 100644 --- a/ppapi/cpp/graphics_3d_client.h +++ b/ppapi/cpp/dev/graphics_3d_client_dev.h @@ -1,9 +1,9 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// 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_GRAPHICS_3D_CLIENT_H_ -#define PPAPI_CPP_GRAPHICS_3D_CLIENT_H_ +#ifndef PPAPI_CPP_DEV_GRAPHICS_3D_CLIENT_DEV_H_ +#define PPAPI_CPP_DEV_GRAPHICS_3D_CLIENT_DEV_H_ #include "ppapi/c/pp_stdint.h" @@ -17,10 +17,10 @@ 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 { +class Graphics3DClient_Dev { public: - Graphics3DClient(Instance* instance); - virtual ~Graphics3DClient(); + Graphics3DClient_Dev(Instance* instance); + virtual ~Graphics3DClient_Dev(); /** * Notification that the context was lost for the 3D devices. @@ -33,4 +33,4 @@ class Graphics3DClient { } // namespace pp -#endif // PPAPI_CPP_DEV_GRAPHICS_3D_CLIENT_H_ +#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 new file mode 100644 index 0000000..953b859 --- /dev/null +++ b/ppapi/cpp/dev/graphics_3d_dev.cc @@ -0,0 +1,76 @@ +// 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/graphics_3d.h b/ppapi/cpp/dev/graphics_3d_dev.h index aaa6d08..30a46e7 100644 --- a/ppapi/cpp/graphics_3d.h +++ b/ppapi/cpp/dev/graphics_3d_dev.h @@ -2,10 +2,10 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#ifndef PPAPI_CPP_GRAPHICS_3D_H_ -#define PPAPI_CPP_GRAPHICS_3D_H_ +#ifndef PPAPI_CPP_DEV_GRAPHICS_3D_DEV_H_ +#define PPAPI_CPP_DEV_GRAPHICS_3D_DEV_H_ -#include "ppapi/c/ppb_graphics_3d.h" +#include "ppapi/c/dev/ppb_graphics_3d_dev.h" #include "ppapi/cpp/resource.h" namespace pp { @@ -14,16 +14,16 @@ class CompletionCallback; class Instance; class Var; -class Graphics3D : public Resource { +class Graphics3D_Dev : public Resource { public: // Creates an is_null() Graphics3D_Dev object. - Graphics3D(); + Graphics3D_Dev(); - Graphics3D(const Instance& instance, - const Graphics3D& share_context, - const int32_t* attrib_list); + Graphics3D_Dev(const Instance& instance, + const Graphics3D_Dev& share_context, + const int32_t* attrib_list); - ~Graphics3D(); + ~Graphics3D_Dev(); int32_t GetAttribs(int32_t* attrib_list) const; int32_t SetAttribs(int32_t* attrib_list); @@ -35,5 +35,5 @@ class Graphics3D : public Resource { } // namespace pp -#endif // PPAPI_CPP_GRAPHICS_3D_H_ +#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 991ad55..f7ab651 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/graphics_3d.h" +#include "ppapi/cpp/dev/graphics_3d_dev.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& context, + const Graphics3D_Dev& 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 b761ef1..e260050 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; +class Graphics3D_Dev; 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& context, + const Graphics3D_Dev& context, PP_VideoDecoder_Profile profile); explicit VideoDecoder_Dev(PP_Resource resource); diff --git a/ppapi/cpp/graphics_3d.cc b/ppapi/cpp/graphics_3d.cc deleted file mode 100644 index 0cd8ba2..0000000 --- a/ppapi/cpp/graphics_3d.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/graphics_3d.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>() { - return PPB_GRAPHICS_3D_INTERFACE; -} - -} // namespace - -Graphics3D::Graphics3D() { -} - -Graphics3D::Graphics3D(const Instance& instance, - const Graphics3D& share_context, - const int32_t* attrib_list) { - if (has_interface<PPB_Graphics3D>()) { - PassRefFromConstructor(get_interface<PPB_Graphics3D>()->Create( - instance.pp_instance(), - share_context.pp_resource(), - attrib_list)); - } -} - -Graphics3D::~Graphics3D() { -} - -int32_t Graphics3D::GetAttribs(int32_t* attrib_list) const { - if (!has_interface<PPB_Graphics3D>()) - return PP_ERROR_NOINTERFACE; - - return get_interface<PPB_Graphics3D>()->GetAttribs( - pp_resource(), - attrib_list); -} - -int32_t Graphics3D::SetAttribs(int32_t* attrib_list) { - if (!has_interface<PPB_Graphics3D>()) - return PP_ERROR_NOINTERFACE; - - return get_interface<PPB_Graphics3D>()->SetAttribs( - pp_resource(), - attrib_list); -} - -int32_t Graphics3D::ResizeBuffers(int32_t width, int32_t height) { - if (!has_interface<PPB_Graphics3D>()) - return PP_ERROR_NOINTERFACE; - - return get_interface<PPB_Graphics3D>()->ResizeBuffers( - pp_resource(), width, height); -} - -int32_t Graphics3D::SwapBuffers(const CompletionCallback& cc) { - if (!has_interface<PPB_Graphics3D>()) - return PP_ERROR_NOINTERFACE; - - return get_interface<PPB_Graphics3D>()->SwapBuffers( - pp_resource(), - cc.pp_completion_callback()); -} - -} // namespace pp - diff --git a/ppapi/cpp/instance.cc b/ppapi/cpp/instance.cc index a6f5997..9bb77dc 100644 --- a/ppapi/cpp/instance.cc +++ b/ppapi/cpp/instance.cc @@ -8,9 +8,9 @@ #include "ppapi/c/ppb_input_event.h" #include "ppapi/c/ppb_instance.h" #include "ppapi/c/ppb_messaging.h" +#include "ppapi/cpp/dev/graphics_3d_dev.h" #include "ppapi/cpp/dev/surface_3d_dev.h" #include "ppapi/cpp/graphics_2d.h" -#include "ppapi/cpp/graphics_3d.h" #include "ppapi/cpp/image_data.h" #include "ppapi/cpp/logging.h" #include "ppapi/cpp/module.h" @@ -82,7 +82,7 @@ bool Instance::BindGraphics(const Graphics2D& graphics) { pp_instance(), graphics.pp_resource())); } -bool Instance::BindGraphics(const Graphics3D& graphics) { +bool Instance::BindGraphics(const Graphics3D_Dev& graphics) { if (!has_interface<PPB_Instance>()) return false; return PP_ToBool(get_interface<PPB_Instance>()->BindGraphics( diff --git a/ppapi/cpp/instance.h b/ppapi/cpp/instance.h index 528c08a..ea145f9 100644 --- a/ppapi/cpp/instance.h +++ b/ppapi/cpp/instance.h @@ -21,7 +21,7 @@ struct PP_InputEvent; namespace pp { class Graphics2D; -class Graphics3D; +class Graphics3D_Dev; class InputEvent; class ImageData; class Point; @@ -275,12 +275,12 @@ class Instance { /// Refer to <code>BindGraphics(const Graphics2D& graphics)</code> for /// further information. /// - /// @param[in] graphics A <code>Graphics3D</code> to bind. + /// @param[in] graphics A <code>Graphics3D_Dev</code> to bind. /// /// @return true if bind was successful or false if the device was not the /// correct type. On success, a reference to the device will be held by the /// instance, so the caller can release its reference if it chooses. - bool BindGraphics(const Graphics3D& graphics); + bool BindGraphics(const Graphics3D_Dev& graphics); /// Binds the given Surface3D as the current display surface. /// Refer to <code>BindGraphics(const Graphics2D& graphics)</code> for |