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

Side by Side Diff: gpu/demos/framework/window.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
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 "gpu/demos/framework/window.h" 5 #include "gpu/demos/framework/window.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "gpu/command_buffer/client/gles2_implementation.h" 10 #include "gpu/command_buffer/client/gles2_implementation.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), 66 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(),
67 decoder_.get(), 67 decoder_.get(),
68 NULL)); 68 NULL));
69 69
70 decoder_->set_engine(gpu_scheduler_.get()); 70 decoder_->set_engine(gpu_scheduler_.get());
71 71
72 surface_ = gfx::GLSurface::CreateViewGLSurface(false, hwnd); 72 surface_ = gfx::GLSurface::CreateViewGLSurface(false, hwnd);
73 if (!surface_.get()) 73 if (!surface_.get())
74 return false; 74 return false;
75 75
76 context_ = gfx::GLContext::CreateGLContext(NULL, surface_.get()); 76 context_ = gfx::GLContext::CreateGLContext(
77 NULL, surface_.get(), gfx::PreferDiscreteGpu);
77 if (!context_.get()) 78 if (!context_.get())
78 return false; 79 return false;
79 80
80 std::vector<int32> attribs; 81 std::vector<int32> attribs;
81 if (!decoder_->Initialize(surface_.get(), 82 if (!decoder_->Initialize(surface_.get(),
82 context_.get(), 83 context_.get(),
83 gfx::Size(), 84 gfx::Size(),
84 gpu::gles2::DisallowedFeatures(), 85 gpu::gles2::DisallowedFeatures(),
85 NULL, 86 NULL,
86 attribs)) { 87 attribs)) {
(...skipping 18 matching lines...) Expand all
105 transfer_buffer.size, 106 transfer_buffer.size,
106 transfer_buffer.ptr, 107 transfer_buffer.ptr,
107 transfer_buffer_id, 108 transfer_buffer_id,
108 false, 109 false,
109 true)); 110 true));
110 return true; 111 return true;
111 } 112 }
112 113
113 } // namespace demos 114 } // namespace demos
114 } // namespace gpu 115 } // namespace gpu
OLDNEW
« no previous file with comments | « content/renderer/render_widget_fullscreen_pepper.cc ('k') | gpu/gles2_conform_support/egl/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698