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