| 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 CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_CONTEXT_3D_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_CONTEXT_3D_H_ |
| 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_CONTEXT_3D_H_ | 6 #define CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_CONTEXT_3D_H_ |
| 7 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 class PlatformContext3D { | 25 class PlatformContext3D { |
| 26 public: | 26 public: |
| 27 explicit PlatformContext3D(); | 27 explicit PlatformContext3D(); |
| 28 ~PlatformContext3D(); | 28 ~PlatformContext3D(); |
| 29 | 29 |
| 30 // Initialize the context. | 30 // Initialize the context. |
| 31 bool Init(const int32* attrib_list, PlatformContext3D* share_context); | 31 bool Init(const int32* attrib_list, PlatformContext3D* share_context); |
| 32 | 32 |
| 33 // Retrieves the mailbox name for the front buffer backing the context. | 33 // Retrieves the mailbox name for the front buffer backing the context. |
| 34 void GetBackingMailbox(gpu::Mailbox* mailbox); | 34 void GetBackingMailbox(gpu::Mailbox* mailbox, uint32* sync_point); |
| 35 |
| 36 // Inserts a new sync point to associate with the backing mailbox, that should |
| 37 // be waited on before using the mailbox. |
| 38 void InsertSyncPointForBackingMailbox(); |
| 35 | 39 |
| 36 // Returns true if the backing texture is always opaque. | 40 // Returns true if the backing texture is always opaque. |
| 37 bool IsOpaque(); | 41 bool IsOpaque(); |
| 38 | 42 |
| 39 // This call will return the address of the command buffer for this context | 43 // This call will return the address of the command buffer for this context |
| 40 // that is constructed in Initialize() and is valid until this context is | 44 // that is constructed in Initialize() and is valid until this context is |
| 41 // destroyed. | 45 // destroyed. |
| 42 gpu::CommandBuffer* GetCommandBuffer(); | 46 gpu::CommandBuffer* GetCommandBuffer(); |
| 43 | 47 |
| 44 // Returns the GpuControl class that services out-of-band messages. | 48 // Returns the GpuControl class that services out-of-band messages. |
| (...skipping 16 matching lines...) Expand all Loading... |
| 61 // Run the callback once the channel has been flushed. | 65 // Run the callback once the channel has been flushed. |
| 62 void Echo(const base::Closure& task); | 66 void Echo(const base::Closure& task); |
| 63 | 67 |
| 64 private: | 68 private: |
| 65 bool InitRaw(); | 69 bool InitRaw(); |
| 66 void OnContextLost(); | 70 void OnContextLost(); |
| 67 void OnConsoleMessage(const std::string& msg, int id); | 71 void OnConsoleMessage(const std::string& msg, int id); |
| 68 | 72 |
| 69 scoped_refptr<GpuChannelHost> channel_; | 73 scoped_refptr<GpuChannelHost> channel_; |
| 70 gpu::Mailbox mailbox_; | 74 gpu::Mailbox mailbox_; |
| 75 uint32 sync_point_; |
| 71 bool has_alpha_; | 76 bool has_alpha_; |
| 72 CommandBufferProxyImpl* command_buffer_; | 77 CommandBufferProxyImpl* command_buffer_; |
| 73 base::Closure context_lost_callback_; | 78 base::Closure context_lost_callback_; |
| 74 ConsoleMessageCallback console_message_callback_; | 79 ConsoleMessageCallback console_message_callback_; |
| 75 base::WeakPtrFactory<PlatformContext3D> weak_ptr_factory_; | 80 base::WeakPtrFactory<PlatformContext3D> weak_ptr_factory_; |
| 76 }; | 81 }; |
| 77 | 82 |
| 78 } // namespace content | 83 } // namespace content |
| 79 | 84 |
| 80 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_CONTEXT_3D_H_ | 85 #endif // CONTENT_RENDERER_PEPPER_PEPPER_PLATFORM_CONTEXT_3D_H_ |
| OLD | NEW |