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

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

Issue 1914233006: Implement offscreenCanvas.getContext('webgl') on a worker thread (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 27 matching lines...) Expand all
38 #include "modules/webgl/WebGLContextAttributes.h" 38 #include "modules/webgl/WebGLContextAttributes.h"
39 #include "modules/webgl/WebGLExtensionName.h" 39 #include "modules/webgl/WebGLExtensionName.h"
40 #include "modules/webgl/WebGLTexture.h" 40 #include "modules/webgl/WebGLTexture.h"
41 #include "modules/webgl/WebGLVertexArrayObjectBase.h" 41 #include "modules/webgl/WebGLVertexArrayObjectBase.h"
42 #include "platform/Timer.h" 42 #include "platform/Timer.h"
43 #include "platform/graphics/GraphicsTypes3D.h" 43 #include "platform/graphics/GraphicsTypes3D.h"
44 #include "platform/graphics/ImageBuffer.h" 44 #include "platform/graphics/ImageBuffer.h"
45 #include "platform/graphics/gpu/DrawingBuffer.h" 45 #include "platform/graphics/gpu/DrawingBuffer.h"
46 #include "platform/graphics/gpu/Extensions3DUtil.h" 46 #include "platform/graphics/gpu/Extensions3DUtil.h"
47 #include "platform/graphics/gpu/WebGLImageConversion.h" 47 #include "platform/graphics/gpu/WebGLImageConversion.h"
48 #include "public/platform/WebGraphicsContext3D.h" 48 #include "public/platform/Platform.h"
49 #include "public/platform/WebGraphicsContext3DProvider.h"
49 #include "wtf/OwnPtr.h" 50 #include "wtf/OwnPtr.h"
50 #include "wtf/text/WTFString.h" 51 #include "wtf/text/WTFString.h"
51 52
52 #include <set> 53 #include <set>
53 54
54 namespace blink { 55 namespace blink {
55 class WebLayer; 56 class WebLayer;
56 } 57 }
57 58
58 namespace gpu { 59 namespace gpu {
(...skipping 18 matching lines...) Expand all
77 class ImageBuffer; 78 class ImageBuffer;
78 class ImageData; 79 class ImageData;
79 class IntSize; 80 class IntSize;
80 class OESElementIndexUint; 81 class OESElementIndexUint;
81 class OESStandardDerivatives; 82 class OESStandardDerivatives;
82 class OESTextureFloat; 83 class OESTextureFloat;
83 class OESTextureFloatLinear; 84 class OESTextureFloatLinear;
84 class OESTextureHalfFloat; 85 class OESTextureHalfFloat;
85 class OESTextureHalfFloatLinear; 86 class OESTextureHalfFloatLinear;
86 class OESVertexArrayObject; 87 class OESVertexArrayObject;
88 class WaitableEvent;
87 class WebGLActiveInfo; 89 class WebGLActiveInfo;
88 class WebGLBuffer; 90 class WebGLBuffer;
89 class WebGLCompressedTextureASTC; 91 class WebGLCompressedTextureASTC;
90 class WebGLCompressedTextureATC; 92 class WebGLCompressedTextureATC;
91 class WebGLCompressedTextureETC1; 93 class WebGLCompressedTextureETC1;
92 class WebGLCompressedTexturePVRTC; 94 class WebGLCompressedTexturePVRTC;
93 class WebGLCompressedTextureS3TC; 95 class WebGLCompressedTextureS3TC;
94 class WebGLContextGroup; 96 class WebGLContextGroup;
95 class WebGLContextObject; 97 class WebGLContextObject;
96 class WebGLDebugRendererInfo; 98 class WebGLDebugRendererInfo;
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after
1072 static void forciblyLoseOldestContext(const String& reason); 1074 static void forciblyLoseOldestContext(const String& reason);
1073 // Return the least recently used context's position in the active context v ector. 1075 // Return the least recently used context's position in the active context v ector.
1074 // If the vector is empty, return the maximum allowed active context number. 1076 // If the vector is empty, return the maximum allowed active context number.
1075 static WebGLRenderingContextBase* oldestContext(); 1077 static WebGLRenderingContextBase* oldestContext();
1076 static WebGLRenderingContextBase* oldestEvictedContext(); 1078 static WebGLRenderingContextBase* oldestEvictedContext();
1077 1079
1078 CrossThreadWeakPersistentThisPointer<WebGLRenderingContextBase> createWeakTh isPointer() { return CrossThreadWeakPersistentThisPointer<WebGLRenderingContextB ase>(this); } 1080 CrossThreadWeakPersistentThisPointer<WebGLRenderingContextBase> createWeakTh isPointer() { return CrossThreadWeakPersistentThisPointer<WebGLRenderingContextB ase>(this); }
1079 1081
1080 private: 1082 private:
1081 WebGLRenderingContextBase(HTMLCanvasElement*, OffscreenCanvas*, PassOwnPtr<W ebGraphicsContext3DProvider>, const WebGLContextAttributes&); 1083 WebGLRenderingContextBase(HTMLCanvasElement*, OffscreenCanvas*, PassOwnPtr<W ebGraphicsContext3DProvider>, const WebGLContextAttributes&);
1084 static PassOwnPtr<WebGraphicsContext3DProvider> createWebGraphicsContext3DPr oviderInternal(HTMLCanvasElement*, ScriptState*, WebGLContextAttributes, unsigne d);
1085 class createWebGraphicsContext3DProviderUtils {
1086 public:
1087 createWebGraphicsContext3DProviderUtils(Platform::ContextAttributes cont extAttributes, Platform::GraphicsInfo glInfo, ScriptState* scriptState)
1088 {
1089 m_contextAttributes = contextAttributes;
1090 m_glInfo = glInfo;
1091 m_scriptState = scriptState;
1092 }
1093 Platform::ContextAttributes contextAttributes() { return m_contextAttrib utes; }
1094 Platform::GraphicsInfo glInfo() { return m_glInfo; }
1095 ScriptState* scriptState() { return m_scriptState; }
1096 void setContextProvider(PassOwnPtr<WebGraphicsContext3DProvider> provide r) { m_provider = std::move(provider); }
1097 PassOwnPtr<WebGraphicsContext3DProvider> releaseContextProvider() { retu rn m_provider.release(); }
1098 private:
1099 Platform::ContextAttributes m_contextAttributes;
1100 Platform::GraphicsInfo m_glInfo;
1101 ScriptState* m_scriptState;
1102 OwnPtr<WebGraphicsContext3DProvider> m_provider;
1103 };
1104 static void createWebGraphicsContext3DProviderMainThread(createWebGraphicsCo ntext3DProviderUtils*, WaitableEvent*);
1082 }; 1105 };
1083 1106
1084 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d()); 1107 DEFINE_TYPE_CASTS(WebGLRenderingContextBase, CanvasRenderingContext, context, co ntext->is3d(), context.is3d());
1085 1108
1086 } // namespace blink 1109 } // namespace blink
1087 1110
1088 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState); 1111 WTF_ALLOW_MOVE_INIT_AND_COMPARE_WITH_MEM_FUNCTIONS(blink::WebGLRenderingContextB ase::TextureUnitState);
1089 1112
1090 #endif // WebGLRenderingContextBase_h 1113 #endif // WebGLRenderingContextBase_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698