| 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_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ | 5 #ifndef WEBKIT_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ |
| 6 #define WEBKIT_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ | 6 #define WEBKIT_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ |
| 7 | 7 |
| 8 #if defined(ENABLE_GPU) | 8 #if defined(ENABLE_GPU) |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 | 43 |
| 44 namespace webkit { | 44 namespace webkit { |
| 45 namespace gpu { | 45 namespace gpu { |
| 46 | 46 |
| 47 class GLInProcessContext; | 47 class GLInProcessContext; |
| 48 | 48 |
| 49 class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl | 49 class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl |
| 50 : public NON_EXPORTED_BASE(WebKit::WebGraphicsContext3D) { | 50 : public NON_EXPORTED_BASE(WebKit::WebGraphicsContext3D) { |
| 51 public: | 51 public: |
| 52 | 52 |
| 53 WebGraphicsContext3DInProcessCommandBufferImpl( | 53 WebGraphicsContext3DInProcessCommandBufferImpl(); |
| 54 const WebKit::WebGraphicsContext3D::Attributes& attributes); | |
| 55 virtual ~WebGraphicsContext3DInProcessCommandBufferImpl(); | 54 virtual ~WebGraphicsContext3DInProcessCommandBufferImpl(); |
| 56 | 55 |
| 56 bool Initialize(WebKit::WebGraphicsContext3D::Attributes attributes, |
| 57 WebKit::WebGraphicsContext3D* view_context); |
| 58 |
| 57 //---------------------------------------------------------------------- | 59 //---------------------------------------------------------------------- |
| 58 // WebGraphicsContext3D methods | 60 // WebGraphicsContext3D methods |
| 59 virtual bool makeContextCurrent(); | 61 virtual bool makeContextCurrent(); |
| 60 | 62 |
| 61 virtual int width(); | 63 virtual int width(); |
| 62 virtual int height(); | 64 virtual int height(); |
| 63 | 65 |
| 64 virtual bool isGLES2Compliant(); | 66 virtual bool isGLES2Compliant(); |
| 65 | 67 |
| 66 virtual bool setParentContext(WebGraphicsContext3D* parent_context); | 68 virtual bool setParentContext(WebGraphicsContext3D* parent_context); |
| (...skipping 437 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 virtual void drawBuffersEXT(WGC3Dsizei n, const WGC3Denum* bufs); | 506 virtual void drawBuffersEXT(WGC3Dsizei n, const WGC3Denum* bufs); |
| 505 | 507 |
| 506 protected: | 508 protected: |
| 507 virtual GrGLInterface* onCreateGrGLInterface(); | 509 virtual GrGLInterface* onCreateGrGLInterface(); |
| 508 | 510 |
| 509 private: | 511 private: |
| 510 // SwapBuffers callback. | 512 // SwapBuffers callback. |
| 511 void OnSwapBuffersComplete(); | 513 void OnSwapBuffersComplete(); |
| 512 virtual void OnContextLost(); | 514 virtual void OnContextLost(); |
| 513 | 515 |
| 514 bool MaybeInitializeGL(); | |
| 515 | |
| 516 // Used to try to find bugs in code that calls gl directly through the gl api | 516 // Used to try to find bugs in code that calls gl directly through the gl api |
| 517 // instead of going through WebGraphicsContext3D. | 517 // instead of going through WebGraphicsContext3D. |
| 518 void ClearContext(); | 518 void ClearContext(); |
| 519 | 519 |
| 520 bool initialized_; | |
| 521 bool initialize_failed_; | |
| 522 | |
| 523 // The context we use for OpenGL rendering. | 520 // The context we use for OpenGL rendering. |
| 524 GLInProcessContext* context_; | 521 GLInProcessContext* context_; |
| 525 // The GLES2Implementation we use for OpenGL rendering. | 522 // The GLES2Implementation we use for OpenGL rendering. |
| 526 ::gpu::gles2::GLES2Implementation* gl_; | 523 ::gpu::gles2::GLES2Implementation* gl_; |
| 527 | 524 |
| 528 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; | 525 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; |
| 529 WGC3Denum context_lost_reason_; | 526 WGC3Denum context_lost_reason_; |
| 530 | 527 |
| 531 WebKit::WebGraphicsContext3D::Attributes attributes_; | 528 WebKit::WebGraphicsContext3D::Attributes attributes_; |
| 532 int cached_width_, cached_height_; | 529 int cached_width_, cached_height_; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 543 unsigned int width, | 540 unsigned int width, |
| 544 unsigned int height); | 541 unsigned int height); |
| 545 #endif | 542 #endif |
| 546 }; | 543 }; |
| 547 | 544 |
| 548 } // namespace gpu | 545 } // namespace gpu |
| 549 } // namespace webkit | 546 } // namespace webkit |
| 550 | 547 |
| 551 #endif // defined(ENABLE_GPU) | 548 #endif // defined(ENABLE_GPU) |
| 552 #endif // WEBKIT_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ | 549 #endif // WEBKIT_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ |
| OLD | NEW |