| 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_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
| 6 #define CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 NONE = 0x3038, // Attrib list = terminator | 664 NONE = 0x3038, // Attrib list = terminator |
| 665 SHARE_RESOURCES = 0x10000, | 665 SHARE_RESOURCES = 0x10000, |
| 666 BIND_GENERATES_RESOURCES = 0x10001 | 666 BIND_GENERATES_RESOURCES = 0x10001 |
| 667 }; | 667 }; |
| 668 friend class WebGraphicsContext3DErrorMessageCallback; | 668 friend class WebGraphicsContext3DErrorMessageCallback; |
| 669 | 669 |
| 670 // Initialize the underlying GL context. May be called multiple times; second | 670 // Initialize the underlying GL context. May be called multiple times; second |
| 671 // and subsequent calls are ignored. Must be called from the thread that is | 671 // and subsequent calls are ignored. Must be called from the thread that is |
| 672 // going to use this object to issue GL commands (which might not be the main | 672 // going to use this object to issue GL commands (which might not be the main |
| 673 // thread). | 673 // thread). |
| 674 bool MaybeInitializeGL(const char* allowed_extensions); | 674 bool MaybeInitializeGL(); |
| 675 | 675 |
| 676 bool InitializeCommandBuffer( | 676 bool InitializeCommandBuffer(bool onscreen); |
| 677 bool onscreen, | |
| 678 const char* allowed_extensions); | |
| 679 | 677 |
| 680 void Destroy(); | 678 void Destroy(); |
| 681 | 679 |
| 682 // Create a CommandBufferProxy that renders directly to a view. The view and | 680 // Create a CommandBufferProxy that renders directly to a view. The view and |
| 683 // the associated window must not be destroyed until the returned | 681 // the associated window must not be destroyed until the returned |
| 684 // CommandBufferProxy has been destroyed, otherwise the GPU process might | 682 // CommandBufferProxy has been destroyed, otherwise the GPU process might |
| 685 // attempt to render to an invalid window handle. | 683 // attempt to render to an invalid window handle. |
| 686 // | 684 // |
| 687 // NOTE: on Mac OS X, this entry point is only used to set up the | 685 // NOTE: on Mac OS X, this entry point is only used to set up the |
| 688 // accelerated compositor's output. On this platform, we actually pass | 686 // accelerated compositor's output. On this platform, we actually pass |
| 689 // a gfx::PluginWindowHandle in place of the gfx::NativeViewId, | 687 // a gfx::PluginWindowHandle in place of the gfx::NativeViewId, |
| 690 // because the facility to allocate a fake PluginWindowHandle is | 688 // because the facility to allocate a fake PluginWindowHandle is |
| 691 // already in place. We could add more entry points and messages to | 689 // already in place. We could add more entry points and messages to |
| 692 // allocate both fake PluginWindowHandles and NativeViewIds and map | 690 // allocate both fake PluginWindowHandles and NativeViewIds and map |
| 693 // from fake NativeViewIds to PluginWindowHandles, but this seems like | 691 // from fake NativeViewIds to PluginWindowHandles, but this seems like |
| 694 // unnecessary complexity at the moment. | 692 // unnecessary complexity at the moment. |
| 695 bool CreateContext(bool onscreen, | 693 bool CreateContext(bool onscreen); |
| 696 const char* allowed_extensions); | |
| 697 | 694 |
| 698 // SwapBuffers callback. | 695 // SwapBuffers callback. |
| 699 void OnSwapBuffersComplete(); | 696 void OnSwapBuffersComplete(); |
| 700 virtual void OnContextLost(); | 697 virtual void OnContextLost(); |
| 701 virtual void OnErrorMessage(const std::string& message, int id); | 698 virtual void OnErrorMessage(const std::string& message, int id); |
| 702 | 699 |
| 703 // Check if we should call into the swap client. We can only do that on the | 700 // Check if we should call into the swap client. We can only do that on the |
| 704 // main thread. | 701 // main thread. |
| 705 bool ShouldUseSwapClient(); | 702 bool ShouldUseSwapClient(); |
| 706 | 703 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 761 size_t command_buffer_size_; | 758 size_t command_buffer_size_; |
| 762 size_t start_transfer_buffer_size_; | 759 size_t start_transfer_buffer_size_; |
| 763 size_t min_transfer_buffer_size_; | 760 size_t min_transfer_buffer_size_; |
| 764 size_t max_transfer_buffer_size_; | 761 size_t max_transfer_buffer_size_; |
| 765 size_t mapped_memory_limit_; | 762 size_t mapped_memory_limit_; |
| 766 }; | 763 }; |
| 767 | 764 |
| 768 } // namespace content | 765 } // namespace content |
| 769 | 766 |
| 770 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ | 767 #endif // CONTENT_COMMON_GPU_CLIENT_WEBGRAPHICSCONTEXT3D_COMMAND_BUFFER_IMPL_H_ |
| OLD | NEW |