Chromium Code Reviews| 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 after initialize() and before any of the following methods. | |
| 52 // Permanently binds to the first calling thread. Returns false if the | |
| 53 // graphics context fails to create. Do not call from more than one thread. | |
| 54 virtual bool BindToCurrentThread() = 0; | |
|
piman
2014/08/15 17:47:34
nit: There's no initialize() method any more. This
| |
| 55 | |
| 49 //---------------------------------------------------------------------- | 56 //---------------------------------------------------------------------- |
| 50 // WebGraphicsContext3D methods | 57 // WebGraphicsContext3D methods |
| 51 | 58 |
| 59 // TODO(dshwang): remove it. | |
| 60 virtual bool makeContextCurrent(); | |
| 52 virtual uint32_t lastFlushID(); | 61 virtual uint32_t lastFlushID(); |
| 53 | 62 |
| 54 virtual unsigned int insertSyncPoint(); | 63 virtual unsigned int insertSyncPoint(); |
| 55 virtual void waitSyncPoint(unsigned int sync_point); | 64 virtual void waitSyncPoint(unsigned int sync_point); |
| 56 | 65 |
| 57 virtual void loseContextCHROMIUM(WGC3Denum current, WGC3Denum other); | 66 virtual void loseContextCHROMIUM(WGC3Denum current, WGC3Denum other); |
| 58 | 67 |
| 59 virtual void reshapeWithScaleFactor( | 68 virtual void reshapeWithScaleFactor( |
| 60 int width, int height, float scale_factor); | 69 int width, int height, float scale_factor); |
| 61 | 70 |
| (...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 563 // Convert WebGL context creation attributes into command buffer / EGL size | 572 // Convert WebGL context creation attributes into command buffer / EGL size |
| 564 // requests. | 573 // requests. |
| 565 static void ConvertAttributes( | 574 static void ConvertAttributes( |
| 566 const blink::WebGraphicsContext3D::Attributes& attributes, | 575 const blink::WebGraphicsContext3D::Attributes& attributes, |
| 567 ::gpu::gles2::ContextCreationAttribHelper* output_attribs); | 576 ::gpu::gles2::ContextCreationAttribHelper* output_attribs); |
| 568 | 577 |
| 569 protected: | 578 protected: |
| 570 friend class WebGraphicsContext3DErrorMessageCallback; | 579 friend class WebGraphicsContext3DErrorMessageCallback; |
| 571 | 580 |
| 572 WebGraphicsContext3DImpl(); | 581 WebGraphicsContext3DImpl(); |
| 573 virtual ~WebGraphicsContext3DImpl(); | |
| 574 | 582 |
| 575 ::gpu::gles2::GLES2ImplementationErrorMessageCallback* | 583 ::gpu::gles2::GLES2ImplementationErrorMessageCallback* |
| 576 getErrorMessageCallback(); | 584 getErrorMessageCallback(); |
| 577 virtual void OnErrorMessage(const std::string& message, int id); | 585 virtual void OnErrorMessage(const std::string& message, int id); |
| 578 | 586 |
| 579 void setGLInterface(::gpu::gles2::GLES2Interface* gl) { | 587 void setGLInterface(::gpu::gles2::GLES2Interface* gl) { |
| 580 gl_ = gl; | 588 gl_ = gl; |
| 581 } | 589 } |
| 582 | 590 |
| 583 bool initialized_; | 591 bool initialized_; |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 596 | 604 |
| 597 ::gpu::gles2::GLES2Interface* gl_; | 605 ::gpu::gles2::GLES2Interface* gl_; |
| 598 bool lose_context_when_out_of_memory_; | 606 bool lose_context_when_out_of_memory_; |
| 599 uint32_t flush_id_; | 607 uint32_t flush_id_; |
| 600 }; | 608 }; |
| 601 | 609 |
| 602 } // namespace gpu | 610 } // namespace gpu |
| 603 } // namespace webkit | 611 } // namespace webkit |
| 604 | 612 |
| 605 #endif // WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IMPL_H_ | 613 #endif // WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IMPL_H_ |
| OLD | NEW |