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

Side by Side Diff: chrome/renderer/webgles2context_impl.cc

Issue 3067026: Initial port of accelerated compositor to Mac OS X 10.6. Reused... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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 | « chrome/renderer/webgles2context_impl.h ('k') | chrome/renderer/webplugin_delegate_proxy.cc » ('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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #if defined(ENABLE_GPU) 5 #if defined(ENABLE_GPU)
6 6
7 #include "chrome/renderer/webgles2context_impl.h" 7 #include "chrome/renderer/webgles2context_impl.h"
8 8
9 #include "chrome/renderer/gpu_channel_host.h" 9 #include "chrome/renderer/gpu_channel_host.h"
10 #include "chrome/renderer/render_thread.h" 10 #include "chrome/renderer/render_thread.h"
(...skipping 27 matching lines...) Expand all
38 return false; 38 return false;
39 DCHECK(host->state() == GpuChannelHost::CONNECTED); 39 DCHECK(host->state() == GpuChannelHost::CONNECTED);
40 40
41 // If a WebView is passed then create a context rendering directly 41 // If a WebView is passed then create a context rendering directly
42 // into the window used by the WebView, otherwise create an offscreen 42 // into the window used by the WebView, otherwise create an offscreen
43 // context. 43 // context.
44 if (web_view) { 44 if (web_view) {
45 RenderView* renderview = RenderView::FromWebView(web_view); 45 RenderView* renderview = RenderView::FromWebView(web_view);
46 if (!renderview) 46 if (!renderview)
47 return false; 47 return false;
48 gfx::NativeViewId view_id = renderview->host_window(); 48 gfx::NativeViewId view_id;
49 context_ = ggl::CreateViewContext(host, view_id); 49 #if !defined(OS_MACOSX)
50 view_id = renderview->host_window();
51 #else
52 view_id = static_cast<gfx::NativeViewId>(
53 renderview->AllocateFakePluginWindowHandle(true, true));
54 #endif
55 context_ = ggl::CreateViewContext(
56 host, view_id,
57 renderview->routing_id());
50 } else { 58 } else {
51 ggl::Context* parent_context = NULL; 59 ggl::Context* parent_context = NULL;
52 60
53 if (parent) { 61 if (parent) {
54 WebGLES2ContextImpl* parent_context_impl = 62 WebGLES2ContextImpl* parent_context_impl =
55 static_cast<WebGLES2ContextImpl*>(parent); 63 static_cast<WebGLES2ContextImpl*>(parent);
56 parent_context = parent_context_impl->context(); 64 parent_context = parent_context_impl->context();
57 DCHECK(parent_context); 65 DCHECK(parent_context);
58 } 66 }
59 context_ = ggl::CreateOffscreenContext(host, parent_context, 67 context_ = ggl::CreateOffscreenContext(host, parent_context,
(...skipping 16 matching lines...) Expand all
76 } 84 }
77 85
78 void WebGLES2ContextImpl::resizeOffscreenContent(const WebKit::WebSize& size) { 86 void WebGLES2ContextImpl::resizeOffscreenContent(const WebKit::WebSize& size) {
79 ggl::ResizeOffscreenContext(context_, size); 87 ggl::ResizeOffscreenContext(context_, size);
80 } 88 }
81 89
82 unsigned WebGLES2ContextImpl::getOffscreenContentParentTextureId() { 90 unsigned WebGLES2ContextImpl::getOffscreenContentParentTextureId() {
83 return ggl::GetParentTextureId(context_); 91 return ggl::GetParentTextureId(context_);
84 } 92 }
85 93
94 #if defined(OS_MACOSX)
95 void WebGLES2ContextImpl::resizeOnscreenContent(const WebKit::WebSize& size) {
96 ggl::ResizeOnscreenContext(context_, size);
97 }
98 #endif
99
86 #endif // defined(ENABLE_GPU) 100 #endif // defined(ENABLE_GPU)
87 101
OLDNEW
« no previous file with comments | « chrome/renderer/webgles2context_impl.h ('k') | chrome/renderer/webplugin_delegate_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698