OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/renderer/render_view_impl.h" | 5 #include "content/renderer/render_view_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 } | 1434 } |
1435 | 1435 |
1436 WebGraphicsContext3D* RenderViewImpl::createGraphicsContext3D( | 1436 WebGraphicsContext3D* RenderViewImpl::createGraphicsContext3D( |
1437 WebGraphicsContext3D::Attributes attributes, | 1437 WebGraphicsContext3D::Attributes attributes, |
1438 bool direct) { | 1438 bool direct) { |
1439 if (!webview()) | 1439 if (!webview()) |
1440 return NULL; | 1440 return NULL; |
1441 // The WebGraphicsContext3DInProcessImpl code path is used for | 1441 // The WebGraphicsContext3DInProcessImpl code path is used for |
1442 // layout tests (though not through this code) as well as for | 1442 // layout tests (though not through this code) as well as for |
1443 // debugging and bringing up new ports. | 1443 // debugging and bringing up new ports. |
1444 scoped_ptr<WebGraphicsContext3D> context; | |
1445 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { | 1444 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { |
1446 context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( | 1445 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView( |
1447 gfx::kNullPluginWindow, NULL)); | 1446 attributes, webview(), direct); |
1448 } else { | 1447 } else { |
1449 #if defined(ENABLE_GPU) | 1448 scoped_ptr<WebGraphicsContext3D> context( |
1450 context.reset(new WebGraphicsContext3DCommandBufferImpl()); | 1449 new WebGraphicsContext3DCommandBufferImpl()); |
1451 #else | 1450 if (!context->initialize(attributes, webview(), direct)) |
1452 return NULL; | 1451 return NULL; |
1453 #endif | 1452 return context.release(); |
1454 } | 1453 } |
1455 if (!context->initialize(attributes, webview(), direct)) | |
1456 return NULL; | |
1457 return context.release(); | |
1458 } | 1454 } |
1459 | 1455 |
1460 void RenderViewImpl::didAddMessageToConsole( | 1456 void RenderViewImpl::didAddMessageToConsole( |
1461 const WebConsoleMessage& message, const WebString& source_name, | 1457 const WebConsoleMessage& message, const WebString& source_name, |
1462 unsigned source_line) { | 1458 unsigned source_line) { |
1463 logging::LogSeverity log_severity = logging::LOG_VERBOSE; | 1459 logging::LogSeverity log_severity = logging::LOG_VERBOSE; |
1464 switch (message.level) { | 1460 switch (message.level) { |
1465 case WebConsoleMessage::LevelTip: | 1461 case WebConsoleMessage::LevelTip: |
1466 log_severity = logging::LOG_VERBOSE; | 1462 log_severity = logging::LOG_VERBOSE; |
1467 break; | 1463 break; |
(...skipping 3436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4904 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 4900 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
4905 return !!RenderThreadImpl::current()->compositor_thread(); | 4901 return !!RenderThreadImpl::current()->compositor_thread(); |
4906 } | 4902 } |
4907 | 4903 |
4908 void RenderViewImpl::OnJavaBridgeInit() { | 4904 void RenderViewImpl::OnJavaBridgeInit() { |
4909 DCHECK(!java_bridge_dispatcher_.get()); | 4905 DCHECK(!java_bridge_dispatcher_.get()); |
4910 #if defined(ENABLE_JAVA_BRIDGE) | 4906 #if defined(ENABLE_JAVA_BRIDGE) |
4911 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); | 4907 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); |
4912 #endif | 4908 #endif |
4913 } | 4909 } |
OLD | NEW |