| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/test_runner/test_plugin.h" | 5 #include "components/test_runner/test_plugin.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 TestPlugin::~TestPlugin() { | 173 TestPlugin::~TestPlugin() { |
| 174 } | 174 } |
| 175 | 175 |
| 176 bool TestPlugin::initialize(blink::WebPluginContainer* container) { | 176 bool TestPlugin::initialize(blink::WebPluginContainer* container) { |
| 177 DCHECK(container); | 177 DCHECK(container); |
| 178 DCHECK_EQ(this, container->plugin()); | 178 DCHECK_EQ(this, container->plugin()); |
| 179 | 179 |
| 180 container_ = container; | 180 container_ = container; |
| 181 | 181 |
| 182 blink::Platform::ContextAttributes attrs; | 182 blink::Platform::ContextAttributes attrs; |
| 183 attrs.webGLVersion = 1; // We are creating a context through the WebGL APIs. |
| 183 DCHECK(!container->element().isNull()); | 184 DCHECK(!container->element().isNull()); |
| 184 DCHECK(!container->element().document().isNull()); | 185 DCHECK(!container->element().document().isNull()); |
| 185 blink::WebURL url = container->element().document().url(); | 186 blink::WebURL url = container->element().document().url(); |
| 186 blink::Platform::GraphicsInfo gl_info; | 187 blink::Platform::GraphicsInfo gl_info; |
| 187 context_provider_ = base::WrapUnique( | 188 context_provider_ = base::WrapUnique( |
| 188 blink::Platform::current()->createOffscreenGraphicsContext3DProvider( | 189 blink::Platform::current()->createOffscreenGraphicsContext3DProvider( |
| 189 attrs, url, nullptr, &gl_info)); | 190 attrs, url, nullptr, &gl_info)); |
| 190 gl_ = context_provider_ ? context_provider_->contextGL() : nullptr; | 191 gl_ = context_provider_ ? context_provider_->contextGL() : nullptr; |
| 191 | 192 |
| 192 if (!InitScene()) | 193 if (!InitScene()) |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 731 return kPluginPersistsMimeType; | 732 return kPluginPersistsMimeType; |
| 732 } | 733 } |
| 733 | 734 |
| 734 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { | 735 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { |
| 735 return mime_type == TestPlugin::MimeType() || | 736 return mime_type == TestPlugin::MimeType() || |
| 736 mime_type == PluginPersistsMimeType() || | 737 mime_type == PluginPersistsMimeType() || |
| 737 mime_type == CanCreateWithoutRendererMimeType(); | 738 mime_type == CanCreateWithoutRendererMimeType(); |
| 738 } | 739 } |
| 739 | 740 |
| 740 } // namespace test_runner | 741 } // namespace test_runner |
| OLD | NEW |