Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(460)

Side by Side Diff: webkit/gpu/webgraphicscontext3d_in_process_command_buffer_impl.h

Issue 14318004: Add option to use GLContextVirtual in WGC3DIPCBI (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix logic, remove ui/gl change (into separate patch) Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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);
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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 529
529 virtual void drawBuffersEXT(WGC3Dsizei n, const WGC3Denum* bufs); 530 virtual void drawBuffersEXT(WGC3Dsizei n, const WGC3Denum* bufs);
530 531
531 protected: 532 protected:
532 virtual GrGLInterface* onCreateGrGLInterface(); 533 virtual GrGLInterface* onCreateGrGLInterface();
533 534
534 private: 535 private:
535 WebGraphicsContext3DInProcessCommandBufferImpl( 536 WebGraphicsContext3DInProcessCommandBufferImpl(
536 const WebKit::WebGraphicsContext3D::Attributes& attributes, 537 const WebKit::WebGraphicsContext3D::Attributes& attributes,
537 bool is_offscreen, 538 bool is_offscreen,
538 gfx::AcceleratedWidget window); 539 gfx::AcceleratedWidget window,
540 bool use_virtualized_gl_context);
539 541
540 // SwapBuffers callback. 542 // SwapBuffers callback.
541 void OnSwapBuffersComplete(); 543 void OnSwapBuffersComplete();
542 virtual void OnContextLost(); 544 virtual void OnContextLost();
543 545
544 bool MaybeInitializeGL(); 546 bool MaybeInitializeGL();
545 547
546 // Used to try to find bugs in code that calls gl directly through the gl api 548 // Used to try to find bugs in code that calls gl directly through the gl api
547 // instead of going through WebGraphicsContext3D. 549 // instead of going through WebGraphicsContext3D.
548 void ClearContext(); 550 void ClearContext();
549 551
550 552
551 bool is_offscreen_; 553 bool is_offscreen_;
552 // Only used when not offscreen. 554 // Only used when not offscreen.
553 gfx::AcceleratedWidget window_; 555 gfx::AcceleratedWidget window_;
554 556
557 bool use_virtualized_gl_context_;
558
555 bool initialized_; 559 bool initialized_;
556 bool initialize_failed_; 560 bool initialize_failed_;
557 561
558 // The context we use for OpenGL rendering. 562 // The context we use for OpenGL rendering.
559 GLInProcessContext* context_; 563 GLInProcessContext* context_;
560 // The GLES2Implementation we use for OpenGL rendering. 564 // The GLES2Implementation we use for OpenGL rendering.
561 ::gpu::gles2::GLES2Implementation* gl_; 565 ::gpu::gles2::GLES2Implementation* gl_;
562 566
563 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; 567 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_;
564 WGC3Denum context_lost_reason_; 568 WGC3Denum context_lost_reason_;
(...skipping 11 matching lines...) Expand all
576 void FlipVertically(uint8* framebuffer, 580 void FlipVertically(uint8* framebuffer,
577 unsigned int width, 581 unsigned int width,
578 unsigned int height); 582 unsigned int height);
579 }; 583 };
580 584
581 } // namespace gpu 585 } // namespace gpu
582 } // namespace webkit 586 } // namespace webkit
583 587
584 #endif // defined(ENABLE_GPU) 588 #endif // defined(ENABLE_GPU)
585 #endif // WEBKIT_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ 589 #endif // WEBKIT_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698