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

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

Issue 8233027: Support dynamic switching between integrated and discrete GPUs on Mac OS X. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | « content/renderer/pepper_platform_context_3d_impl.cc ('k') | gpu/demos/framework/window.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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_widget_fullscreen_pepper.h" 5 #include "content/renderer/render_widget_fullscreen_pepper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/message_loop.h" 8 #include "base/message_loop.h"
9 #include "content/common/view_messages.h" 9 #include "content/common/view_messages.h"
10 #include "content/renderer/gpu/gpu_channel_host.h" 10 #include "content/renderer/gpu/gpu_channel_host.h"
11 #include "content/renderer/pepper_platform_context_3d_impl.h" 11 #include "content/renderer/pepper_platform_context_3d_impl.h"
12 #include "content/renderer/render_thread_impl.h" 12 #include "content/renderer/render_thread_impl.h"
13 #include "gpu/command_buffer/client/gles2_implementation.h" 13 #include "gpu/command_buffer/client/gles2_implementation.h"
14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h" 14 #include "third_party/WebKit/Source/WebKit/chromium/public/WebCursorInfo.h"
15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h" 15 #include "third_party/WebKit/Source/WebKit/chromium/public/WebSize.h"
16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h" 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebWidget.h"
17 #include "ui/gfx/gl/gpu_preference.h"
17 #include "webkit/plugins/ppapi/plugin_delegate.h" 18 #include "webkit/plugins/ppapi/plugin_delegate.h"
18 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h" 19 #include "webkit/plugins/ppapi/ppapi_plugin_instance.h"
19 20
20 using WebKit::WebCanvas; 21 using WebKit::WebCanvas;
21 using WebKit::WebCompositionUnderline; 22 using WebKit::WebCompositionUnderline;
22 using WebKit::WebCursorInfo; 23 using WebKit::WebCursorInfo;
23 using WebKit::WebInputEvent; 24 using WebKit::WebInputEvent;
24 using WebKit::WebMouseEvent; 25 using WebKit::WebMouseEvent;
25 using WebKit::WebPoint; 26 using WebKit::WebPoint;
26 using WebKit::WebRect; 27 using WebKit::WebRect;
(...skipping 328 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 RendererGLContext::SHARE_RESOURCES, 0, 356 RendererGLContext::SHARE_RESOURCES, 0,
356 RendererGLContext::BIND_GENERATES_RESOURCES, 1, 357 RendererGLContext::BIND_GENERATES_RESOURCES, 1,
357 RendererGLContext::NONE, 358 RendererGLContext::NONE,
358 }; 359 };
359 context_ = RendererGLContext::CreateViewContext( 360 context_ = RendererGLContext::CreateViewContext(
360 host, 361 host,
361 routing_id(), 362 routing_id(),
362 NULL, 363 NULL,
363 "GL_OES_packed_depth_stencil GL_OES_depth24", 364 "GL_OES_packed_depth_stencil GL_OES_depth24",
364 attribs, 365 attribs,
365 active_url_); 366 active_url_,
367 gfx::PreferIntegratedGpu);
366 if (!context_) 368 if (!context_)
367 return; 369 return;
368 370
369 if (!InitContext()) { 371 if (!InitContext()) {
370 DestroyContext(context_, program_, buffer_); 372 DestroyContext(context_, program_, buffer_);
371 context_ = NULL; 373 context_ = NULL;
372 return; 374 return;
373 } 375 }
374 context_->SetContextLostCallback( 376 context_->SetContextLostCallback(
375 base::Bind(&RenderWidgetFullscreenPepper::OnLostContext, this)); 377 base::Bind(&RenderWidgetFullscreenPepper::OnLostContext, this));
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 context_ = NULL; 505 context_ = NULL;
504 program_ = 0; 506 program_ = 0;
505 buffer_ = 0; 507 buffer_ = 0;
506 OnSwapBuffersAborted(); 508 OnSwapBuffersAborted();
507 CheckCompositing(); 509 CheckCompositing();
508 } 510 }
509 511
510 void RenderWidgetFullscreenPepper::OnSwapBuffersCompleteByRendererGLContext() { 512 void RenderWidgetFullscreenPepper::OnSwapBuffersCompleteByRendererGLContext() {
511 OnSwapBuffersComplete(); 513 OnSwapBuffersComplete();
512 } 514 }
OLDNEW
« no previous file with comments | « content/renderer/pepper_platform_context_3d_impl.cc ('k') | gpu/demos/framework/window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698