Changeset 77900 in webkit
- Timestamp:
- Feb 7, 2011 10:25:20 PM (13 years ago)
- Location:
- trunk/Source
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r77895 r77900 1 2011-02-07 Alexey Marinichev <amarinichev@chromium.org> 2 3 Reviewed by Kenneth Russell. 4 5 Hook up WebGraphicsContext3D::setContextLostCallback. 6 https://bugs.webkit.org/show_bug.cgi?id=53722 7 8 Test: fast/canvas/webgl/context-lost.html, comment out the line with 9 extension.loseContext() and kill the GPU process "Lose context" 10 message shows up. 11 12 * html/canvas/WebGLRenderingContext.cpp: 13 (WebCore::WebGLRenderingContextLostCallback::WebGLRenderingContextLostCallback): 14 (WebCore::WebGLRenderingContextLostCallback::onContextLost): 15 (WebCore::WebGLRenderingContextLostCallback::~WebGLRenderingContextLostCallback): 16 (WebCore::WebGLRenderingContext::initializeNewContext): 17 (WebCore::WebGLRenderingContext::~WebGLRenderingContext): 18 * platform/graphics/GraphicsContext3D.h: 19 (WebCore::GraphicsContext3D::ContextLostCallback::~ContextLostCallback): 20 * platform/graphics/mac/GraphicsContext3DMac.mm: 21 (WebCore::GraphicsContext3D::setContextLostCallback): stub 22 * platform/graphics/qt/GraphicsContext3DQt.cpp: 23 (WebCore::GraphicsContext3D::setContextLostCallback): stub 24 1 25 2011-02-07 Patrick Gansterer <paroga@webkit.org> 2 26 -
trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp
r77821 r77900 342 342 } 343 343 344 class WebGLRenderingContextLostCallback : public GraphicsContext3D::ContextLostCallback { 345 public: 346 WebGLRenderingContextLostCallback(WebGLRenderingContext* cb) : m_contextLostCallback(cb) {} 347 virtual void onContextLost() { m_contextLostCallback->forceLostContext(); } 348 virtual ~WebGLRenderingContextLostCallback() {} 349 private: 350 WebGLRenderingContext* m_contextLostCallback; 351 }; 352 344 353 PassOwnPtr<WebGLRenderingContext> WebGLRenderingContext::create(HTMLCanvasElement* canvas, WebGLContextAttributes* attrs) 345 354 { … … 417 426 m_context->reshape(canvas()->width(), canvas()->height()); 418 427 m_context->viewport(0, 0, canvas()->width(), canvas()->height()); 428 429 m_context->setContextLostCallback(adoptPtr(new WebGLRenderingContextLostCallback(this))); 419 430 } 420 431 … … 438 449 { 439 450 detachAndRemoveAllObjects(); 451 m_context->setContextLostCallback(0); 440 452 } 441 453 -
trunk/Source/WebCore/platform/graphics/GraphicsContext3D.h
r76549 r77900 455 455 }; 456 456 457 class ContextLostCallback { 458 public: 459 virtual void onContextLost() = 0; 460 virtual ~ContextLostCallback() {} 461 }; 462 463 void setContextLostCallback(PassOwnPtr<ContextLostCallback>); 464 457 465 static PassRefPtr<GraphicsContext3D> create(Attributes, HostWindow*, RenderStyle = RenderOffscreen); 458 466 ~GraphicsContext3D(); -
trunk/Source/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
r76600 r77900 246 246 } 247 247 248 void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback>) 249 { 250 } 251 248 252 } 249 253 -
trunk/Source/WebCore/platform/graphics/qt/GraphicsContext3DQt.cpp
r76600 r77900 1648 1648 } 1649 1649 1650 void GraphicsContext3D::setContextLostCallback(PassOwnPtr<ContextLostCallback>) 1651 { 1652 } 1653 1650 1654 } 1651 1655 -
trunk/Source/WebKit/chromium/ChangeLog
r77896 r77900 1 2011-02-07 Alexey Marinichev <amarinichev@chromium.org> 2 3 Reviewed by Kenneth Russell. 4 5 Hook up WebGraphicsContext3D::setContextLostCallback. 6 https://bugs.webkit.org/show_bug.cgi?id=53722 7 8 Test: fast/canvas/webgl/context-lost.html, comment out the line with 9 extension.loseContext() and kill the GPU process "Lose context" 10 message shows up. 11 12 * public/WebGraphicsContext3D.h: 13 (WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback::~WebGraphicsContextLostCallback): 14 * src/GraphicsContext3DChromium.cpp: 15 (WebCore::GraphicsContextLostCallbackAdapter::~GraphicsContextLostCallbackAdapter): 16 (WebCore::GraphicsContextLostCallbackAdapter::GraphicsContextLostCallbackAdapter): 17 (WebCore::GraphicsContextLostCallbackAdapter::onContextLost): 18 (WebCore::GraphicsContextLostCallbackAdapter::create): 19 (WebCore::GraphicsContext3DInternal::setContextLostCallback): 20 * src/GraphicsContext3DInternal.h: 21 1 22 2011-02-07 Adam Klein <adamk@chromium.org> 2 23 -
trunk/Source/WebKit/chromium/public/WebGraphicsContext3D.h
r76876 r77900 100 100 public: 101 101 virtual void onContextLost() = 0; 102 virtual ~WebGraphicsContextLostCallback() {} 102 103 }; 103 104 -
trunk/Source/WebKit/chromium/src/GraphicsContext3DChromium.cpp
r77242 r77900 1083 1083 DELEGATE_TO_INTERNAL_R(getExtensions, Extensions3D*) 1084 1084 1085 DELEGATE_TO_INTERNAL_1(setContextLostCallback, PassOwnPtr<GraphicsContext3D::ContextLostCallback>) 1086 1087 class GraphicsContextLostCallbackAdapter : public WebKit::WebGraphicsContext3D::WebGraphicsContextLostCallback { 1088 public: 1089 virtual void onContextLost(); 1090 static PassOwnPtr<GraphicsContextLostCallbackAdapter> create(PassOwnPtr<GraphicsContext3D::ContextLostCallback>); 1091 virtual ~GraphicsContextLostCallbackAdapter() {} 1092 private: 1093 GraphicsContextLostCallbackAdapter(PassOwnPtr<GraphicsContext3D::ContextLostCallback> cb) : m_contextLostCallback(cb) {} 1094 OwnPtr<GraphicsContext3D::ContextLostCallback> m_contextLostCallback; 1095 }; 1096 1097 void GraphicsContextLostCallbackAdapter::onContextLost() 1098 { 1099 if (m_contextLostCallback) 1100 m_contextLostCallback->onContextLost(); 1101 } 1102 1103 PassOwnPtr<GraphicsContextLostCallbackAdapter> GraphicsContextLostCallbackAdapter::create(PassOwnPtr<GraphicsContext3D::ContextLostCallback> cb) 1104 { 1105 return adoptPtr(new GraphicsContextLostCallbackAdapter(cb)); 1106 } 1107 1108 void GraphicsContext3DInternal::setContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback> cb) 1109 { 1110 m_contextLostCallbackAdapter = GraphicsContextLostCallbackAdapter::create(cb); 1111 m_impl->setContextLostCallback(m_contextLostCallbackAdapter.get()); 1112 } 1113 1085 1114 bool GraphicsContext3D::isGLES2Compliant() const 1086 1115 { -
trunk/Source/WebKit/chromium/src/GraphicsContext3DInternal.h
r76717 r77900 45 45 class WebGLLayerChromium; 46 46 #endif 47 class GraphicsContextLostCallbackAdapter; 47 48 48 49 class GraphicsContext3DInternal { … … 240 241 void synthesizeGLError(GC3Denum error); 241 242 243 void setContextLostCallback(PassOwnPtr<GraphicsContext3D::ContextLostCallback>); 244 242 245 // Extensions3D support. 243 246 Extensions3D* getExtensions(); … … 266 269 OwnPtr<WebKit::WebGraphicsContext3D> m_impl; 267 270 OwnPtr<Extensions3DChromium> m_extensions; 271 OwnPtr<GraphicsContextLostCallbackAdapter> m_contextLostCallbackAdapter; 268 272 WebKit::WebViewImpl* m_webViewImpl; 269 273 bool m_initializedAvailableExtensions;
Note: See TracChangeset
for help on using the changeset viewer.