| 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 WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IMPL_H_ | 5 #ifndef WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IMPL_H_ |
| 6 #define WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IMPL_H_ | 6 #define WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IMPL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 using blink::WGC3Dsizeiptr; | 39 using blink::WGC3Dsizeiptr; |
| 40 | 40 |
| 41 namespace webkit { | 41 namespace webkit { |
| 42 namespace gpu { | 42 namespace gpu { |
| 43 | 43 |
| 44 class WebGraphicsContext3DErrorMessageCallback; | 44 class WebGraphicsContext3DErrorMessageCallback; |
| 45 | 45 |
| 46 class WEBKIT_GPU_EXPORT WebGraphicsContext3DImpl | 46 class WEBKIT_GPU_EXPORT WebGraphicsContext3DImpl |
| 47 : public NON_EXPORTED_BASE(blink::WebGraphicsContext3D) { | 47 : public NON_EXPORTED_BASE(blink::WebGraphicsContext3D) { |
| 48 public: | 48 public: |
| 49 virtual ~WebGraphicsContext3DImpl(); |
| 50 |
| 51 // Must be called before any of the following methods. Permanently binds to |
| 52 // the first calling thread. Returns false if the graphics context fails to |
| 53 // initialize. Do not call from more than one thread. |
| 54 virtual bool InitializeOnCurrentThread() = 0; |
| 55 |
| 49 //---------------------------------------------------------------------- | 56 //---------------------------------------------------------------------- |
| 50 // WebGraphicsContext3D methods | 57 // WebGraphicsContext3D methods |
| 51 | 58 |
| 52 virtual uint32_t lastFlushID(); | 59 virtual uint32_t lastFlushID(); |
| 53 | 60 |
| 54 virtual unsigned int insertSyncPoint(); | 61 virtual unsigned int insertSyncPoint(); |
| 55 virtual void waitSyncPoint(unsigned int sync_point); | 62 virtual void waitSyncPoint(unsigned int sync_point); |
| 56 | 63 |
| 57 virtual void loseContextCHROMIUM(WGC3Denum current, WGC3Denum other); | 64 virtual void loseContextCHROMIUM(WGC3Denum current, WGC3Denum other); |
| 58 | 65 |
| (...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 // Convert WebGL context creation attributes into command buffer / EGL size | 570 // Convert WebGL context creation attributes into command buffer / EGL size |
| 564 // requests. | 571 // requests. |
| 565 static void ConvertAttributes( | 572 static void ConvertAttributes( |
| 566 const blink::WebGraphicsContext3D::Attributes& attributes, | 573 const blink::WebGraphicsContext3D::Attributes& attributes, |
| 567 ::gpu::gles2::ContextCreationAttribHelper* output_attribs); | 574 ::gpu::gles2::ContextCreationAttribHelper* output_attribs); |
| 568 | 575 |
| 569 protected: | 576 protected: |
| 570 friend class WebGraphicsContext3DErrorMessageCallback; | 577 friend class WebGraphicsContext3DErrorMessageCallback; |
| 571 | 578 |
| 572 WebGraphicsContext3DImpl(); | 579 WebGraphicsContext3DImpl(); |
| 573 virtual ~WebGraphicsContext3DImpl(); | |
| 574 | 580 |
| 575 ::gpu::gles2::GLES2ImplementationErrorMessageCallback* | 581 ::gpu::gles2::GLES2ImplementationErrorMessageCallback* |
| 576 getErrorMessageCallback(); | 582 getErrorMessageCallback(); |
| 577 virtual void OnErrorMessage(const std::string& message, int id); | 583 virtual void OnErrorMessage(const std::string& message, int id); |
| 578 | 584 |
| 579 void setGLInterface(::gpu::gles2::GLES2Interface* gl) { | 585 void setGLInterface(::gpu::gles2::GLES2Interface* gl) { |
| 580 gl_ = gl; | 586 gl_ = gl; |
| 581 } | 587 } |
| 582 | 588 |
| 583 bool initialized_; | 589 bool initialized_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 596 | 602 |
| 597 ::gpu::gles2::GLES2Interface* gl_; | 603 ::gpu::gles2::GLES2Interface* gl_; |
| 598 bool lose_context_when_out_of_memory_; | 604 bool lose_context_when_out_of_memory_; |
| 599 uint32_t flush_id_; | 605 uint32_t flush_id_; |
| 600 }; | 606 }; |
| 601 | 607 |
| 602 } // namespace gpu | 608 } // namespace gpu |
| 603 } // namespace webkit | 609 } // namespace webkit |
| 604 | 610 |
| 605 #endif // WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IMPL_H_ | 611 #endif // WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IMPL_H_ |
| OLD | NEW |