| 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 #ifndef PPAPI_SHARED_IMPL_GRAPHICS_3D_IMPL_H_ |   5 #ifndef PPAPI_SHARED_IMPL_GRAPHICS_3D_IMPL_H_ | 
|   6 #define PPAPI_SHARED_IMPL_GRAPHICS_3D_IMPL_H_ |   6 #define PPAPI_SHARED_IMPL_GRAPHICS_3D_IMPL_H_ | 
|   7  |   7  | 
|   8 #include <stdint.h> |   8 #include <stdint.h> | 
|   9  |   9  | 
|  10 #include "base/macros.h" |  10 #include "base/macros.h" | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
|  33       public thunk::PPB_Graphics3D_API { |  33       public thunk::PPB_Graphics3D_API { | 
|  34  public: |  34  public: | 
|  35   // Resource overrides. |  35   // Resource overrides. | 
|  36   thunk::PPB_Graphics3D_API* AsPPB_Graphics3D_API() override; |  36   thunk::PPB_Graphics3D_API* AsPPB_Graphics3D_API() override; | 
|  37  |  37  | 
|  38   // PPB_Graphics3D_API implementation. |  38   // PPB_Graphics3D_API implementation. | 
|  39   int32_t GetAttribs(int32_t attrib_list[]) override; |  39   int32_t GetAttribs(int32_t attrib_list[]) override; | 
|  40   int32_t SetAttribs(const int32_t attrib_list[]) override; |  40   int32_t SetAttribs(const int32_t attrib_list[]) override; | 
|  41   int32_t GetError() override; |  41   int32_t GetError() override; | 
|  42   int32_t ResizeBuffers(int32_t width, int32_t height) override; |  42   int32_t ResizeBuffers(int32_t width, int32_t height) override; | 
|  43   int32_t SwapBuffers(scoped_refptr<TrackedCallback> callback) override; |  43   int32_t SwapBuffers(scoped_refptr<TrackedCallback> callback, | 
 |  44                       const gpu::SyncToken& sync_token) override; | 
|  44   int32_t GetAttribMaxValue(int32_t attribute, int32_t* value) override; |  45   int32_t GetAttribMaxValue(int32_t attribute, int32_t* value) override; | 
|  45  |  46  | 
|  46   void* MapTexSubImage2DCHROMIUM(GLenum target, |  47   void* MapTexSubImage2DCHROMIUM(GLenum target, | 
|  47                                  GLint level, |  48                                  GLint level, | 
|  48                                  GLint xoffset, |  49                                  GLint xoffset, | 
|  49                                  GLint yoffset, |  50                                  GLint yoffset, | 
|  50                                  GLsizei width, |  51                                  GLsizei width, | 
|  51                                  GLsizei height, |  52                                  GLsizei height, | 
|  52                                  GLenum format, |  53                                  GLenum format, | 
|  53                                  GLenum type, |  54                                  GLenum type, | 
|  54                                  GLenum access) override; |  55                                  GLenum access) override; | 
|  55   void UnmapTexSubImage2DCHROMIUM(const void* mem) override; |  56   void UnmapTexSubImage2DCHROMIUM(const void* mem) override; | 
|  56  |  57  | 
|  57   gpu::gles2::GLES2Implementation* gles2_impl() { return gles2_impl_.get(); } |  58   gpu::gles2::GLES2Implementation* gles2_impl() { return gles2_impl_.get(); } | 
|  58   gpu::gles2::GLES2Interface* gles2_interface(); |  59   gpu::gles2::GLES2Interface* gles2_interface(); | 
|  59  |  60  | 
|  60   // Sends swap-buffers notification to the plugin. |  61   // Sends swap-buffers notification to the plugin. | 
|  61   void SwapBuffersACK(int32_t pp_error); |  62   void SwapBuffersACK(int32_t pp_error); | 
|  62  |  63  | 
|  63  protected: |  64  protected: | 
|  64   PPB_Graphics3D_Shared(PP_Instance instance); |  65   PPB_Graphics3D_Shared(PP_Instance instance); | 
|  65   PPB_Graphics3D_Shared(const HostResource& host_resource); |  66   PPB_Graphics3D_Shared(const HostResource& host_resource); | 
|  66   ~PPB_Graphics3D_Shared() override; |  67   ~PPB_Graphics3D_Shared() override; | 
|  67  |  68  | 
|  68   virtual gpu::CommandBuffer* GetCommandBuffer() = 0; |  69   virtual gpu::CommandBuffer* GetCommandBuffer() = 0; | 
|  69   virtual gpu::GpuControl* GetGpuControl() = 0; |  70   virtual gpu::GpuControl* GetGpuControl() = 0; | 
|  70   virtual int32_t DoSwapBuffers() = 0; |  71   virtual int32_t DoSwapBuffers(const gpu::SyncToken& sync_token) = 0; | 
|  71  |  72  | 
|  72   bool HasPendingSwap() const; |  73   bool HasPendingSwap() const; | 
|  73   bool CreateGLES2Impl(int32_t command_buffer_size, |  74   bool CreateGLES2Impl(int32_t command_buffer_size, | 
|  74                        int32_t transfer_buffer_size, |  75                        int32_t transfer_buffer_size, | 
|  75                        gpu::gles2::GLES2Implementation* share_gles2); |  76                        gpu::gles2::GLES2Implementation* share_gles2); | 
|  76   void DestroyGLES2Impl(); |  77   void DestroyGLES2Impl(); | 
|  77  |  78  | 
|  78  private: |  79  private: | 
|  79   scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; |  80   scoped_ptr<gpu::gles2::GLES2CmdHelper> gles2_helper_; | 
|  80   scoped_ptr<gpu::TransferBuffer> transfer_buffer_; |  81   scoped_ptr<gpu::TransferBuffer> transfer_buffer_; | 
|  81   scoped_ptr<gpu::gles2::GLES2Implementation> gles2_impl_; |  82   scoped_ptr<gpu::gles2::GLES2Implementation> gles2_impl_; | 
|  82  |  83  | 
|  83   // Callback that needs to be executed when swap-buffers is completed. |  84   // Callback that needs to be executed when swap-buffers is completed. | 
|  84   scoped_refptr<TrackedCallback> swap_callback_; |  85   scoped_refptr<TrackedCallback> swap_callback_; | 
|  85  |  86  | 
|  86   DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Shared); |  87   DISALLOW_COPY_AND_ASSIGN(PPB_Graphics3D_Shared); | 
|  87 }; |  88 }; | 
|  88  |  89  | 
|  89 }  // namespace ppapi |  90 }  // namespace ppapi | 
|  90  |  91  | 
|  91 #endif  // PPAPI_SHARED_IMPL_GRAPHICS_3D_IMPL_H_ |  92 #endif  // PPAPI_SHARED_IMPL_GRAPHICS_3D_IMPL_H_ | 
| OLD | NEW |