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

Side by Side Diff: Source/core/html/canvas/WebGLRenderingContextBase.h

Issue 894143002: Adding Blink bindings for WebGL 2 (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed accidentally added scratch file Created 5 years, 10 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2009 Apple Inc. All rights reserved. 2 * Copyright (C) 2009 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WebGLRenderingContextBase); 108 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(WebGLRenderingContextBase);
109 public: 109 public:
110 virtual ~WebGLRenderingContextBase(); 110 virtual ~WebGLRenderingContextBase();
111 111
112 virtual unsigned version() const = 0; 112 virtual unsigned version() const = 0;
113 virtual String contextName() const = 0; 113 virtual String contextName() const = 0;
114 virtual void registerContextExtensions() = 0; 114 virtual void registerContextExtensions() = 0;
115 115
116 static unsigned getWebGLVersion(const CanvasRenderingContext*); 116 static unsigned getWebGLVersion(const CanvasRenderingContext*);
117 117
118 static PassOwnPtr<blink::WebGraphicsContext3D> createWebGraphicsContext3D(HT MLCanvasElement*, WebGLContextAttributes, unsigned webGLVersion);
119 static void forceNextWebGLContextCreationToFail();
120
118 int drawingBufferWidth() const; 121 int drawingBufferWidth() const;
119 int drawingBufferHeight() const; 122 int drawingBufferHeight() const;
120 123
121 void activeTexture(GLenum texture); 124 void activeTexture(GLenum texture);
122 void attachShader(WebGLProgram*, WebGLShader*); 125 void attachShader(WebGLProgram*, WebGLShader*);
123 void bindAttribLocation(WebGLProgram*, GLuint index, const String& name); 126 void bindAttribLocation(WebGLProgram*, GLuint index, const String& name);
124 void bindBuffer(GLenum target, WebGLBuffer*); 127 void bindBuffer(GLenum target, WebGLBuffer*);
125 void bindFramebuffer(GLenum target, WebGLFramebuffer*); 128 void bindFramebuffer(GLenum target, WebGLFramebuffer*);
126 void bindRenderbuffer(GLenum target, WebGLRenderbuffer*); 129 void bindRenderbuffer(GLenum target, WebGLRenderbuffer*);
127 void bindTexture(GLenum target, WebGLTexture*); 130 void bindTexture(GLenum target, WebGLTexture*);
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 PassRefPtr<WebGLSharedWebGraphicsContext3D> sharedWebGraphicsContext3D() con st; 417 PassRefPtr<WebGLSharedWebGraphicsContext3D> sharedWebGraphicsContext3D() con st;
415 #endif 418 #endif
416 419
417 // CanvasRenderingContext implementation. 420 // CanvasRenderingContext implementation.
418 virtual bool is3d() const override { return true; } 421 virtual bool is3d() const override { return true; }
419 virtual bool isAccelerated() const override { return true; } 422 virtual bool isAccelerated() const override { return true; }
420 virtual void setIsHidden(bool) override; 423 virtual void setIsHidden(bool) override;
421 bool paintRenderingResultsToCanvas(SourceDrawingBuffer) override; 424 bool paintRenderingResultsToCanvas(SourceDrawingBuffer) override;
422 virtual blink::WebLayer* platformLayer() const override; 425 virtual blink::WebLayer* platformLayer() const override;
423 426
427 bool isWebGL2OrHigher() { return version() >= 2; }
428
424 void addSharedObject(WebGLSharedObject*); 429 void addSharedObject(WebGLSharedObject*);
425 void addContextObject(WebGLContextObject*); 430 void addContextObject(WebGLContextObject*);
426 void detachAndRemoveAllObjects(); 431 void detachAndRemoveAllObjects();
427 432
428 void destroyContext(); 433 void destroyContext();
429 void markContextChanged(ContentChangeType); 434 void markContextChanged(ContentChangeType);
430 435
431 // Query if the GL implementation is NPOT strict. 436 // Query if the GL implementation is NPOT strict.
432 bool isGLES2NPOTStrict() { return m_isGLES2NPOTStrict; } 437 bool isGLES2NPOTStrict() { return m_isGLES2NPOTStrict; }
433 // Query if depth_stencil buffer is supported. 438 // Query if depth_stencil buffer is supported.
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
984 static IntSize oldestContextSize(); 989 static IntSize oldestContextSize();
985 }; 990 };
986 991
987 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 992 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
988 993
989 } // namespace blink 994 } // namespace blink
990 995
991 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); 996 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState);
992 997
993 #endif // WebGLRenderingContextBase_h 998 #endif // WebGLRenderingContextBase_h
OLDNEW
« no previous file with comments | « Source/core/html/canvas/WebGLRenderingContext.cpp ('k') | Source/core/html/canvas/WebGLRenderingContextBase.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698