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

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

Issue 22277004: Add gfx::SurfaceFactoryWebview (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: InProcessContext takes attrib struct Created 7 years, 4 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_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ 5 #ifndef WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_
6 #define WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL_H_ 6 #define WEBKIT_COMMON_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 21 matching lines...) Expand all
32 using WebKit::WGC3Dint; 32 using WebKit::WGC3Dint;
33 using WebKit::WGC3Dsizei; 33 using WebKit::WGC3Dsizei;
34 using WebKit::WGC3Duint; 34 using WebKit::WGC3Duint;
35 using WebKit::WGC3Dfloat; 35 using WebKit::WGC3Dfloat;
36 using WebKit::WGC3Dclampf; 36 using WebKit::WGC3Dclampf;
37 using WebKit::WGC3Dintptr; 37 using WebKit::WGC3Dintptr;
38 using WebKit::WGC3Dsizeiptr; 38 using WebKit::WGC3Dsizeiptr;
39 39
40 namespace gpu { 40 namespace gpu {
41 class GLInProcessContext; 41 class GLInProcessContext;
42 class GLInProcessContextAttribs;
42 } 43 }
43 44
44 namespace webkit { 45 namespace webkit {
45 namespace gpu { 46 namespace gpu {
46 47
47 class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl 48 class WEBKIT_GPU_EXPORT WebGraphicsContext3DInProcessCommandBufferImpl
48 : public NON_EXPORTED_BASE(WebKit::WebGraphicsContext3D) { 49 : public NON_EXPORTED_BASE(WebKit::WebGraphicsContext3D) {
49 public: 50 public:
50 static scoped_ptr<WebKit::WebGraphicsContext3D> CreateViewContext( 51 static scoped_ptr<WebKit::WebGraphicsContext3D> CreateViewContext(
51 const WebKit::WebGraphicsContext3D::Attributes& attributes, 52 const WebKit::WebGraphicsContext3D::Attributes& attributes,
52 gfx::AcceleratedWidget window); 53 gfx::AcceleratedWidget window);
53 54
54 static scoped_ptr<WebKit::WebGraphicsContext3D> CreateOffscreenContext( 55 static scoped_ptr<WebKit::WebGraphicsContext3D> CreateOffscreenContext(
55 const WebKit::WebGraphicsContext3D::Attributes& attributes); 56 const WebKit::WebGraphicsContext3D::Attributes& attributes);
56 57
58 static scoped_ptr<WebKit::WebGraphicsContext3D> WrapContext(
59 scoped_ptr< ::gpu::GLInProcessContext> context,
60 const WebKit::WebGraphicsContext3D::Attributes& attributes);
no sievers 2013/08/07 01:52:38 Wouldn't it make more sense if WGC3D got the attri
boliu 2013/08/07 02:58:48 I think that's a layering violation that gpu code
61
57 virtual ~WebGraphicsContext3DInProcessCommandBufferImpl(); 62 virtual ~WebGraphicsContext3DInProcessCommandBufferImpl();
58 63
64 // Convert WebGL context creation attributes into GLInProcessContext / EGL
65 // size requests.
66 static void ConvertAttributes(
67 const WebKit::WebGraphicsContext3D::Attributes& attributes,
68 ::gpu::GLInProcessContextAttribs* output_attribs);
69
59 //---------------------------------------------------------------------- 70 //----------------------------------------------------------------------
60 // WebGraphicsContext3D methods 71 // WebGraphicsContext3D methods
61 virtual bool makeContextCurrent(); 72 virtual bool makeContextCurrent();
62 73
63 virtual int width(); 74 virtual int width();
64 virtual int height(); 75 virtual int height();
65 76
66 virtual void reshape(int width, int height); 77 virtual void reshape(int width, int height);
67 virtual void reshapeWithScaleFactor(int width, int height, float scaleFactor); 78 virtual void reshapeWithScaleFactor(int width, int height, float scaleFactor);
68 79
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 virtual void signalQuery(unsigned query, 540 virtual void signalQuery(unsigned query,
530 WebGraphicsSyncPointCallback* callback); 541 WebGraphicsSyncPointCallback* callback);
531 542
532 virtual void loseContextCHROMIUM(WGC3Denum current, WGC3Denum other); 543 virtual void loseContextCHROMIUM(WGC3Denum current, WGC3Denum other);
533 544
534 protected: 545 protected:
535 virtual GrGLInterface* onCreateGrGLInterface(); 546 virtual GrGLInterface* onCreateGrGLInterface();
536 547
537 private: 548 private:
538 WebGraphicsContext3DInProcessCommandBufferImpl( 549 WebGraphicsContext3DInProcessCommandBufferImpl(
550 scoped_ptr< ::gpu::GLInProcessContext> context,
539 const WebKit::WebGraphicsContext3D::Attributes& attributes, 551 const WebKit::WebGraphicsContext3D::Attributes& attributes,
540 bool is_offscreen, 552 bool is_offscreen,
541 gfx::AcceleratedWidget window); 553 gfx::AcceleratedWidget window);
542 554
543 // SwapBuffers callback. 555 // SwapBuffers callback.
544 void OnSwapBuffersComplete(); 556 void OnSwapBuffersComplete();
545 virtual void OnContextLost(); 557 virtual void OnContextLost();
546 558
547 bool MaybeInitializeGL(); 559 bool MaybeInitializeGL();
548 560
(...skipping 22 matching lines...) Expand all
571 583
572 // Errors raised by synthesizeGLError(). 584 // Errors raised by synthesizeGLError().
573 std::vector<WGC3Denum> synthetic_errors_; 585 std::vector<WGC3Denum> synthetic_errors_;
574 }; 586 };
575 587
576 } // namespace gpu 588 } // namespace gpu
577 } // namespace webkit 589 } // namespace webkit
578 590
579 #endif // defined(ENABLE_GPU) 591 #endif // defined(ENABLE_GPU)
580 #endif // WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL _H_ 592 #endif // WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IN_PROCESS_COMMAND_BUFFER_IMPL _H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698