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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 9226036: Refactor WebGraphicsContext3DInProcess and TestWebGraphicsContext3D (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix windows build Created 8 years, 10 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
« no previous file with comments | « no previous file | content/renderer/renderer_webkitplatformsupport_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 (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 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
1473 } 1473 }
1474 1474
1475 WebGraphicsContext3D* RenderViewImpl::createGraphicsContext3D( 1475 WebGraphicsContext3D* RenderViewImpl::createGraphicsContext3D(
1476 const WebGraphicsContext3D::Attributes& attributes, 1476 const WebGraphicsContext3D::Attributes& attributes,
1477 bool direct) { 1477 bool direct) {
1478 if (!webview()) 1478 if (!webview())
1479 return NULL; 1479 return NULL;
1480 // The WebGraphicsContext3DInProcessImpl code path is used for 1480 // The WebGraphicsContext3DInProcessImpl code path is used for
1481 // layout tests (though not through this code) as well as for 1481 // layout tests (though not through this code) as well as for
1482 // debugging and bringing up new ports. 1482 // debugging and bringing up new ports.
1483 scoped_ptr<WebGraphicsContext3D> context;
1484 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) { 1483 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInProcessWebGL)) {
1485 context.reset(new webkit::gpu::WebGraphicsContext3DInProcessImpl( 1484 return webkit::gpu::WebGraphicsContext3DInProcessImpl::CreateForWebView(
1486 gfx::kNullPluginWindow, NULL)); 1485 attributes, webview(), direct);
1487 } else { 1486 } else {
1488 #if defined(ENABLE_GPU) 1487 scoped_ptr<WebGraphicsContext3D> context(
1489 context.reset(new WebGraphicsContext3DCommandBufferImpl()); 1488 new WebGraphicsContext3DCommandBufferImpl());
1490 #else 1489 if (!context->initialize(attributes, webview(), direct))
1491 return NULL; 1490 return NULL;
1492 #endif 1491 return context.release();
1493 } 1492 }
1494 if (!context->initialize(attributes, webview(), direct))
1495 return NULL;
1496 return context.release();
1497 } 1493 }
1498 1494
1499 void RenderViewImpl::didAddMessageToConsole( 1495 void RenderViewImpl::didAddMessageToConsole(
1500 const WebConsoleMessage& message, const WebString& source_name, 1496 const WebConsoleMessage& message, const WebString& source_name,
1501 unsigned source_line) { 1497 unsigned source_line) {
1502 logging::LogSeverity log_severity = logging::LOG_VERBOSE; 1498 logging::LogSeverity log_severity = logging::LOG_VERBOSE;
1503 switch (message.level) { 1499 switch (message.level) {
1504 case WebConsoleMessage::LevelTip: 1500 case WebConsoleMessage::LevelTip:
1505 log_severity = logging::LOG_VERBOSE; 1501 log_severity = logging::LOG_VERBOSE;
1506 break; 1502 break;
(...skipping 3441 matching lines...) Expand 10 before | Expand all | Expand 10 after
4948 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { 4944 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const {
4949 return !!RenderThreadImpl::current()->compositor_thread(); 4945 return !!RenderThreadImpl::current()->compositor_thread();
4950 } 4946 }
4951 4947
4952 void RenderViewImpl::OnJavaBridgeInit() { 4948 void RenderViewImpl::OnJavaBridgeInit() {
4953 DCHECK(!java_bridge_dispatcher_.get()); 4949 DCHECK(!java_bridge_dispatcher_.get());
4954 #if defined(ENABLE_JAVA_BRIDGE) 4950 #if defined(ENABLE_JAVA_BRIDGE)
4955 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this)); 4951 java_bridge_dispatcher_.reset(new JavaBridgeDispatcher(this));
4956 #endif 4952 #endif
4957 } 4953 }
OLDNEW
« no previous file with comments | « no previous file | content/renderer/renderer_webkitplatformsupport_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698