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

Side by Side Diff: components/test_runner/test_plugin.cc

Issue 1990063004: Move bindToCurrentThread out to the creators of WebGL contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bindwebgl: . 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
« no previous file with comments | « no previous file | content/renderer/renderer_blink_platform_impl.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 attrs.webGLVersion = 1; // We are creating a context through the WebGL APIs.
184 blink::WebURL url = container->document().url(); 184 blink::WebURL url = container->document().url();
185 blink::Platform::GraphicsInfo gl_info; 185 blink::Platform::GraphicsInfo gl_info;
186 context_provider_ = base::WrapUnique( 186 context_provider_ = base::WrapUnique(
187 blink::Platform::current()->createOffscreenGraphicsContext3DProvider( 187 blink::Platform::current()->createOffscreenGraphicsContext3DProvider(
188 attrs, url, nullptr, &gl_info, blink::Platform::BindToCurrentThread)); 188 attrs, url, nullptr, &gl_info));
189 if (!context_provider_->bindToCurrentThread())
190 context_provider_ = nullptr;
189 gl_ = context_provider_ ? context_provider_->contextGL() : nullptr; 191 gl_ = context_provider_ ? context_provider_->contextGL() : nullptr;
190 192
191 if (!InitScene()) 193 if (!InitScene())
192 return false; 194 return false;
193 195
194 layer_ = cc::TextureLayer::CreateForMailbox(this); 196 layer_ = cc::TextureLayer::CreateForMailbox(this);
195 web_layer_ = base::WrapUnique(new cc_blink::WebLayerImpl(layer_)); 197 web_layer_ = base::WrapUnique(new cc_blink::WebLayerImpl(layer_));
196 container_->setWebLayer(web_layer_.get()); 198 container_->setWebLayer(web_layer_.get());
197 if (re_request_touch_events_) { 199 if (re_request_touch_events_) {
198 container_->requestTouchEventType( 200 container_->requestTouchEventType(
(...skipping 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 return kPluginPersistsMimeType; 732 return kPluginPersistsMimeType;
731 } 733 }
732 734
733 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) { 735 bool TestPlugin::IsSupportedMimeType(const blink::WebString& mime_type) {
734 return mime_type == TestPlugin::MimeType() || 736 return mime_type == TestPlugin::MimeType() ||
735 mime_type == PluginPersistsMimeType() || 737 mime_type == PluginPersistsMimeType() ||
736 mime_type == CanCreateWithoutRendererMimeType(); 738 mime_type == CanCreateWithoutRendererMimeType();
737 } 739 }
738 740
739 } // namespace test_runner 741 } // namespace test_runner
OLDNEW
« no previous file with comments | « no previous file | content/renderer/renderer_blink_platform_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698