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 30 matching lines...) Expand all Loading... |
41 namespace gpu { | 41 namespace gpu { |
42 | 42 |
43 class GLInProcessContext; | 43 class GLInProcessContext; |
44 | 44 |
45 class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl | 45 class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl |
46 : public NON_EXPORTED_BASE(WebKit::WebGraphicsContext3D) { | 46 : public NON_EXPORTED_BASE(WebKit::WebGraphicsContext3D) { |
47 public: | 47 public: |
48 static WebGraphicsContext3DInProcessCommandBufferImpl* | 48 static WebGraphicsContext3DInProcessCommandBufferImpl* |
49 CreateViewContext( | 49 CreateViewContext( |
50 const WebKit::WebGraphicsContext3D::Attributes& attributes, | 50 const WebKit::WebGraphicsContext3D::Attributes& attributes, |
51 gfx::AcceleratedWidget window); | 51 gfx::AcceleratedWidget window, |
| 52 bool use_virtualized_gl_context_if_possible); |
52 | 53 |
53 static WebGraphicsContext3DInProcessCommandBufferImpl* | 54 static WebGraphicsContext3DInProcessCommandBufferImpl* |
54 CreateOffscreenContext( | 55 CreateOffscreenContext( |
55 const WebKit::WebGraphicsContext3D::Attributes& attributes); | 56 const WebKit::WebGraphicsContext3D::Attributes& attributes); |
56 | 57 |
57 virtual ~WebGraphicsContext3DInProcessCommandBufferImpl(); | 58 virtual ~WebGraphicsContext3DInProcessCommandBufferImpl(); |
58 | 59 |
59 //---------------------------------------------------------------------- | 60 //---------------------------------------------------------------------- |
60 // WebGraphicsContext3D methods | 61 // WebGraphicsContext3D methods |
61 virtual bool makeContextCurrent(); | 62 virtual bool makeContextCurrent(); |
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 | 534 |
534 virtual void drawBuffersEXT(WGC3Dsizei n, const WGC3Denum* bufs); | 535 virtual void drawBuffersEXT(WGC3Dsizei n, const WGC3Denum* bufs); |
535 | 536 |
536 protected: | 537 protected: |
537 virtual GrGLInterface* onCreateGrGLInterface(); | 538 virtual GrGLInterface* onCreateGrGLInterface(); |
538 | 539 |
539 private: | 540 private: |
540 WebGraphicsContext3DInProcessCommandBufferImpl( | 541 WebGraphicsContext3DInProcessCommandBufferImpl( |
541 const WebKit::WebGraphicsContext3D::Attributes& attributes, | 542 const WebKit::WebGraphicsContext3D::Attributes& attributes, |
542 bool is_offscreen, | 543 bool is_offscreen, |
543 gfx::AcceleratedWidget window); | 544 gfx::AcceleratedWidget window, |
| 545 bool use_virtualized_gl_context_if_possible); |
544 | 546 |
545 // SwapBuffers callback. | 547 // SwapBuffers callback. |
546 void OnSwapBuffersComplete(); | 548 void OnSwapBuffersComplete(); |
547 virtual void OnContextLost(); | 549 virtual void OnContextLost(); |
548 | 550 |
549 bool MaybeInitializeGL(); | 551 bool MaybeInitializeGL(); |
550 | 552 |
551 // Used to try to find bugs in code that calls gl directly through the gl api | 553 // Used to try to find bugs in code that calls gl directly through the gl api |
552 // instead of going through WebGraphicsContext3D. | 554 // instead of going through WebGraphicsContext3D. |
553 void ClearContext(); | 555 void ClearContext(); |
554 | 556 |
555 | 557 |
556 bool is_offscreen_; | 558 bool is_offscreen_; |
557 // Only used when not offscreen. | 559 // Only used when not offscreen. |
558 gfx::AcceleratedWidget window_; | 560 gfx::AcceleratedWidget window_; |
559 | 561 |
| 562 bool use_virtualized_gl_context_if_possible_; |
| 563 |
560 bool initialized_; | 564 bool initialized_; |
561 bool initialize_failed_; | 565 bool initialize_failed_; |
562 | 566 |
563 // The context we use for OpenGL rendering. | 567 // The context we use for OpenGL rendering. |
564 GLInProcessContext* context_; | 568 GLInProcessContext* context_; |
565 // The GLES2Implementation we use for OpenGL rendering. | 569 // The GLES2Implementation we use for OpenGL rendering. |
566 ::gpu::gles2::GLES2Implementation* gl_; | 570 ::gpu::gles2::GLES2Implementation* gl_; |
567 | 571 |
568 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; | 572 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; |
569 WGC3Denum context_lost_reason_; | 573 WGC3Denum context_lost_reason_; |
(...skipping 11 matching lines...) Expand all Loading... |
581 void FlipVertically(uint8* framebuffer, | 585 void FlipVertically(uint8* framebuffer, |
582 unsigned int width, | 586 unsigned int width, |
583 unsigned int height); | 587 unsigned int height); |
584 }; | 588 }; |
585 | 589 |
586 } // namespace gpu | 590 } // namespace gpu |
587 } // namespace webkit | 591 } // namespace webkit |
588 | 592 |
589 #endif // defined(ENABLE_GPU) | 593 #endif // defined(ENABLE_GPU) |
590 #endif // WEBKIT_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ | 594 #endif // WEBKIT_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ |
OLD | NEW |