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