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

Side by Side Diff: gpu/blink/webgraphicscontext3d_impl.h

Issue 761243002: Extract WebGraphicsContext3DImpl from webkit/common/gpu. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix GN - content_shell links Created 6 years 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
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_IMPL_H_ 5 #ifndef GPU_BLINK_WEBGRAPHICSCONTEXT3D_IMPL_H_
6 #define WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IMPL_H_ 6 #define GPU_BLINK_WEBGRAPHICSCONTEXT3D_IMPL_H_
7 7
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "gpu/blink/gpu_blink_export.h"
13 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h" 14 #include "third_party/WebKit/public/platform/WebGraphicsContext3D.h"
14 #include "third_party/WebKit/public/platform/WebString.h" 15 #include "third_party/WebKit/public/platform/WebString.h"
15 #include "webkit/common/gpu/webkit_gpu_export.h" 16
17 using blink::WGC3Dbitfield;
18 using blink::WGC3Dboolean;
19 using blink::WGC3Dbyte;
20 using blink::WGC3Dchar;
21 using blink::WGC3Dclampf;
22 using blink::WGC3Denum;
23 using blink::WGC3Dfloat;
24 using blink::WGC3Dint;
25 using blink::WGC3Dintptr;
26 using blink::WGC3Dsizei;
27 using blink::WGC3Dsizeiptr;
28 using blink::WGC3Duint;
29 using blink::WebGLId;
16 30
17 namespace gpu { 31 namespace gpu {
18 32
19 namespace gles2 { 33 namespace gles2 {
20 class GLES2Interface; 34 class GLES2Interface;
21 class GLES2ImplementationErrorMessageCallback; 35 class GLES2ImplementationErrorMessageCallback;
22 struct ContextCreationAttribHelper; 36 struct ContextCreationAttribHelper;
23 } 37 }
24 } 38 }
25 39
26 using blink::WebGLId; 40 namespace gpu_blink {
27
28 using blink::WGC3Dbyte;
29 using blink::WGC3Dchar;
30 using blink::WGC3Denum;
31 using blink::WGC3Dboolean;
32 using blink::WGC3Dbitfield;
33 using blink::WGC3Dint;
34 using blink::WGC3Dsizei;
35 using blink::WGC3Duint;
36 using blink::WGC3Dfloat;
37 using blink::WGC3Dclampf;
38 using blink::WGC3Dintptr;
39 using blink::WGC3Dsizeiptr;
40
41 namespace webkit {
42 namespace gpu {
43 41
44 class WebGraphicsContext3DErrorMessageCallback; 42 class WebGraphicsContext3DErrorMessageCallback;
45 43
46 class WEBKIT_GPU_EXPORT WebGraphicsContext3DImpl 44 class GPU_BLINK_EXPORT WebGraphicsContext3DImpl
47 : public NON_EXPORTED_BASE(blink::WebGraphicsContext3D) { 45 : public NON_EXPORTED_BASE(blink::WebGraphicsContext3D) {
48 public: 46 public:
49 virtual ~WebGraphicsContext3DImpl(); 47 virtual ~WebGraphicsContext3DImpl();
50 48
51 //---------------------------------------------------------------------- 49 //----------------------------------------------------------------------
52 // WebGraphicsContext3D methods 50 // WebGraphicsContext3D methods
53 51
54 virtual uint32_t lastFlushID(); 52 virtual uint32_t lastFlushID();
55 53
56 virtual unsigned int insertSyncPoint(); 54 virtual unsigned int insertSyncPoint();
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 WGC3Denum textarget, 557 WGC3Denum textarget,
560 WebGLId texture, 558 WebGLId texture,
561 WGC3Dint level, 559 WGC3Dint level,
562 WGC3Dsizei samples); 560 WGC3Dsizei samples);
563 virtual void renderbufferStorageMultisampleEXT( 561 virtual void renderbufferStorageMultisampleEXT(
564 WGC3Denum target, WGC3Dsizei samples, WGC3Denum internalformat, 562 WGC3Denum target, WGC3Dsizei samples, WGC3Denum internalformat,
565 WGC3Dsizei width, WGC3Dsizei height); 563 WGC3Dsizei width, WGC3Dsizei height);
566 564
567 virtual GrGLInterface* createGrGLInterface(); 565 virtual GrGLInterface* createGrGLInterface();
568 566
569 ::gpu::gles2::GLES2Interface* GetGLInterface() { 567 gpu::gles2::GLES2Interface* GetGLInterface() {
570 return gl_; 568 return gl_;
571 } 569 }
572 570
573 // Convert WebGL context creation attributes into command buffer / EGL size 571 // Convert WebGL context creation attributes into command buffer / EGL size
574 // requests. 572 // requests.
575 static void ConvertAttributes( 573 static void ConvertAttributes(
576 const blink::WebGraphicsContext3D::Attributes& attributes, 574 const blink::WebGraphicsContext3D::Attributes& attributes,
577 ::gpu::gles2::ContextCreationAttribHelper* output_attribs); 575 gpu::gles2::ContextCreationAttribHelper* output_attribs);
578 576
579 protected: 577 protected:
580 friend class WebGraphicsContext3DErrorMessageCallback; 578 friend class WebGraphicsContext3DErrorMessageCallback;
581 579
582 WebGraphicsContext3DImpl(); 580 WebGraphicsContext3DImpl();
583 581
584 ::gpu::gles2::GLES2ImplementationErrorMessageCallback* 582 gpu::gles2::GLES2ImplementationErrorMessageCallback*
585 getErrorMessageCallback(); 583 getErrorMessageCallback();
586 virtual void OnErrorMessage(const std::string& message, int id); 584 virtual void OnErrorMessage(const std::string& message, int id);
587 585
588 void setGLInterface(::gpu::gles2::GLES2Interface* gl) { 586 void setGLInterface(gpu::gles2::GLES2Interface* gl) {
589 gl_ = gl; 587 gl_ = gl;
590 } 588 }
591 589
592 bool initialized_; 590 bool initialized_;
593 bool initialize_failed_; 591 bool initialize_failed_;
594 592
595 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_; 593 WebGraphicsContext3D::WebGraphicsContextLostCallback* context_lost_callback_;
596 WGC3Denum context_lost_reason_; 594 WGC3Denum context_lost_reason_;
597 595
598 WebGraphicsContext3D::WebGraphicsErrorMessageCallback* 596 WebGraphicsContext3D::WebGraphicsErrorMessageCallback*
599 error_message_callback_; 597 error_message_callback_;
600 scoped_ptr<WebGraphicsContext3DErrorMessageCallback> 598 scoped_ptr<WebGraphicsContext3DErrorMessageCallback>
601 client_error_message_callback_; 599 client_error_message_callback_;
602 600
603 // Errors raised by synthesizeGLError(). 601 // Errors raised by synthesizeGLError().
604 std::vector<WGC3Denum> synthetic_errors_; 602 std::vector<WGC3Denum> synthetic_errors_;
605 603
606 ::gpu::gles2::GLES2Interface* gl_; 604 gpu::gles2::GLES2Interface* gl_;
607 bool lose_context_when_out_of_memory_; 605 bool lose_context_when_out_of_memory_;
608 uint32_t flush_id_; 606 uint32_t flush_id_;
609 }; 607 };
610 608
611 } // namespace gpu 609 } // namespace gpu_blink
612 } // namespace webkit
613 610
614 #endif // WEBKIT_COMMON_GPU_WEBGRAPHICSCONTEXT3D_IMPL_H_ 611 #endif // GPU_BLINK_WEBGRAPHICSCONTEXT3D_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698