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

Side by Side Diff: Source/core/html/canvas/WebGLDebugShaders.cpp

Issue 15876011: Make WebGL extensions get lost when context is lost. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 21 matching lines...) Expand all
32 #include "core/platform/graphics/Extensions3D.h" 32 #include "core/platform/graphics/Extensions3D.h"
33 33
34 #include <wtf/OwnArrayPtr.h> 34 #include <wtf/OwnArrayPtr.h>
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 WebGLDebugShaders::WebGLDebugShaders(WebGLRenderingContext* context) 38 WebGLDebugShaders::WebGLDebugShaders(WebGLRenderingContext* context)
39 : WebGLExtension(context) 39 : WebGLExtension(context)
40 { 40 {
41 ScriptWrappable::init(this); 41 ScriptWrappable::init(this);
42 enable();
42 } 43 }
43 44
44 WebGLDebugShaders::~WebGLDebugShaders() 45 WebGLDebugShaders::~WebGLDebugShaders()
45 { 46 {
46 } 47 }
47 48
49 void WebGLDebugShaders::enable()
50 {
51 }
52
48 WebGLExtension::ExtensionName WebGLDebugShaders::getName() const 53 WebGLExtension::ExtensionName WebGLDebugShaders::getName() const
49 { 54 {
50 return WebGLDebugShadersName; 55 return WebGLDebugShadersName;
51 } 56 }
52 57
53 PassOwnPtr<WebGLDebugShaders> WebGLDebugShaders::create(WebGLRenderingContext* c ontext) 58 PassOwnPtr<WebGLDebugShaders> WebGLDebugShaders::create(WebGLRenderingContext* c ontext)
54 { 59 {
55 return adoptPtr(new WebGLDebugShaders(context)); 60 return adoptPtr(new WebGLDebugShaders(context));
56 } 61 }
57 62
58 String WebGLDebugShaders::getTranslatedShaderSource(WebGLShader* shader, Excepti onCode& ec) 63 String WebGLDebugShaders::getTranslatedShaderSource(WebGLShader* shader, Excepti onCode& ec)
59 { 64 {
60 UNUSED_PARAM(ec); 65 UNUSED_PARAM(ec);
61 if (m_context->isContextLost()) 66 if (isLost())
62 return String(); 67 return String();
63 if (!m_context->validateWebGLObject("getTranslatedShaderSource", shader)) 68 if (!m_context->validateWebGLObject("getTranslatedShaderSource", shader))
64 return ""; 69 return "";
65 return m_context->graphicsContext3D()->getExtensions()->getTranslatedShaderS ourceANGLE(shader->object()); 70 return m_context->graphicsContext3D()->getExtensions()->getTranslatedShaderS ourceANGLE(shader->object());
66 } 71 }
67 72
68 bool WebGLDebugShaders::supported(WebGLRenderingContext* context) 73 bool WebGLDebugShaders::supported(WebGLRenderingContext* context)
69 { 74 {
70 Extensions3D* extensions = context->graphicsContext3D()->getExtensions(); 75 Extensions3D* extensions = context->graphicsContext3D()->getExtensions();
71 return extensions->supports("GL_ANGLE_translated_shader_source"); 76 return extensions->supports("GL_ANGLE_translated_shader_source");
72 } 77 }
73 78
74 const char* WebGLDebugShaders::getExtensionName() 79 const char* WebGLDebugShaders::getExtensionName()
75 { 80 {
76 return "WEBGL_debug_shaders"; 81 return "WEBGL_debug_shaders";
77 } 82 }
78 83
79 } // namespace WebCore 84 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698