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

Side by Side Diff: third_party/WebKit/Source/modules/webgl/WebGLRenderingContext.h

Issue 1881563003: Implement OffscreenCanvas.getContext('webgl') (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase and remove static_cast Created 4 years, 7 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 25 matching lines...) Expand all
36 class WebGLRenderingContext final : public WebGLRenderingContextBase { 36 class WebGLRenderingContext final : public WebGLRenderingContextBase {
37 DEFINE_WRAPPERTYPEINFO(); 37 DEFINE_WRAPPERTYPEINFO();
38 public: 38 public:
39 class Factory : public CanvasRenderingContextFactory { 39 class Factory : public CanvasRenderingContextFactory {
40 WTF_MAKE_NONCOPYABLE(Factory); 40 WTF_MAKE_NONCOPYABLE(Factory);
41 public: 41 public:
42 Factory() {} 42 Factory() {}
43 ~Factory() override {} 43 ~Factory() override {}
44 44
45 CanvasRenderingContext* create(HTMLCanvasElement*, const CanvasContextCr eationAttributes&, Document&) override; 45 CanvasRenderingContext* create(HTMLCanvasElement*, const CanvasContextCr eationAttributes&, Document&) override;
46 CanvasRenderingContext* create(ScriptState*, OffscreenCanvas*, const Can vasContextCreationAttributes&) override;
46 CanvasRenderingContext::ContextType getContextType() const override { re turn CanvasRenderingContext::ContextWebgl; } 47 CanvasRenderingContext::ContextType getContextType() const override { re turn CanvasRenderingContext::ContextWebgl; }
47 void onError(HTMLCanvasElement*, const String& error) override; 48 void onError(HTMLCanvasElement*, const String& error) override;
48 }; 49 };
49 50
50 ~WebGLRenderingContext() override; 51 ~WebGLRenderingContext() override;
51 52
52 CanvasRenderingContext::ContextType getContextType() const override { return CanvasRenderingContext::ContextWebgl; } 53 CanvasRenderingContext::ContextType getContextType() const override { return CanvasRenderingContext::ContextWebgl; }
54 ImageBitmap* transferToImageBitmap(ExceptionState&) final;
53 unsigned version() const override { return 1; } 55 unsigned version() const override { return 1; }
54 String contextName() const override { return "WebGLRenderingContext"; } 56 String contextName() const override { return "WebGLRenderingContext"; }
55 void registerContextExtensions() override; 57 void registerContextExtensions() override;
56 void setCanvasGetContextResult(RenderingContext&) final; 58 void setCanvasGetContextResult(RenderingContext&) final;
59 void setOffscreenCanvasGetContextResult(OffscreenRenderingContext&) final;
57 60
58 EAGERLY_FINALIZE(); 61 EAGERLY_FINALIZE();
59 DECLARE_VIRTUAL_TRACE(); 62 DECLARE_VIRTUAL_TRACE();
60 63
61 private: 64 private:
62 WebGLRenderingContext(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext3DPro vider>, const WebGLContextAttributes&); 65 WebGLRenderingContext(HTMLCanvasElement*, PassOwnPtr<WebGraphicsContext3DPro vider>, const WebGLContextAttributes&);
66 WebGLRenderingContext(OffscreenCanvas*, PassOwnPtr<WebGraphicsContext3DProvi der>, const WebGLContextAttributes&);
63 67
64 // Enabled extension objects. 68 // Enabled extension objects.
65 Member<ANGLEInstancedArrays> m_angleInstancedArrays; 69 Member<ANGLEInstancedArrays> m_angleInstancedArrays;
66 Member<EXTBlendMinMax> m_extBlendMinMax; 70 Member<EXTBlendMinMax> m_extBlendMinMax;
67 Member<EXTDisjointTimerQuery> m_extDisjointTimerQuery; 71 Member<EXTDisjointTimerQuery> m_extDisjointTimerQuery;
68 Member<EXTFragDepth> m_extFragDepth; 72 Member<EXTFragDepth> m_extFragDepth;
69 Member<EXTShaderTextureLOD> m_extShaderTextureLOD; 73 Member<EXTShaderTextureLOD> m_extShaderTextureLOD;
70 Member<EXTsRGB> m_extsRGB; 74 Member<EXTsRGB> m_extsRGB;
71 Member<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic; 75 Member<EXTTextureFilterAnisotropic> m_extTextureFilterAnisotropic;
72 Member<OESTextureFloat> m_oesTextureFloat; 76 Member<OESTextureFloat> m_oesTextureFloat;
(...skipping 15 matching lines...) Expand all
88 Member<WebGLDepthTexture> m_webglDepthTexture; 92 Member<WebGLDepthTexture> m_webglDepthTexture;
89 }; 93 };
90 94
91 DEFINE_TYPE_CASTS(WebGLRenderingContext, CanvasRenderingContext, context, 95 DEFINE_TYPE_CASTS(WebGLRenderingContext, CanvasRenderingContext, context,
92 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) == 1, 96 context->is3d() && WebGLRenderingContextBase::getWebGLVersion(context) == 1,
93 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) == 1) ; 97 context.is3d() && WebGLRenderingContextBase::getWebGLVersion(&context) == 1) ;
94 98
95 } // namespace blink 99 } // namespace blink
96 100
97 #endif // WebGLRenderingContext_h 101 #endif // WebGLRenderingContext_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698