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

Side by Side Diff: ui/accelerated_widget_mac/io_surface_context.mm

Issue 826353002: Don't supply value for boolean attribute (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « no previous file | no next file » | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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 "ui/accelerated_widget_mac/io_surface_context.h" 5 #include "ui/accelerated_widget_mac/io_surface_context.h"
6 6
7 #include <OpenGL/gl.h> 7 #include <OpenGL/gl.h>
8 #include <OpenGL/OpenGL.h> 8 #include <OpenGL/OpenGL.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 17 matching lines...) Expand all
28 return found->second; 28 return found->second;
29 } 29 }
30 30
31 base::ScopedTypeRef<CGLContextObj> cgl_context; 31 base::ScopedTypeRef<CGLContextObj> cgl_context;
32 CGLError error = kCGLNoError; 32 CGLError error = kCGLNoError;
33 33
34 // Create the pixel format object for the context. 34 // Create the pixel format object for the context.
35 std::vector<CGLPixelFormatAttribute> attribs; 35 std::vector<CGLPixelFormatAttribute> attribs;
36 attribs.push_back(kCGLPFADepthSize); 36 attribs.push_back(kCGLPFADepthSize);
37 attribs.push_back(static_cast<CGLPixelFormatAttribute>(0)); 37 attribs.push_back(static_cast<CGLPixelFormatAttribute>(0));
38 if (ui::GpuSwitchingManager::GetInstance()->SupportsDualGpus()) { 38 if (ui::GpuSwitchingManager::GetInstance()->SupportsDualGpus())
39 attribs.push_back(kCGLPFAAllowOfflineRenderers); 39 attribs.push_back(kCGLPFAAllowOfflineRenderers);
40 attribs.push_back(static_cast<CGLPixelFormatAttribute>(1));
41 }
42 attribs.push_back(static_cast<CGLPixelFormatAttribute>(0)); 40 attribs.push_back(static_cast<CGLPixelFormatAttribute>(0));
43 GLint number_virtual_screens = 0; 41 GLint number_virtual_screens = 0;
44 base::ScopedTypeRef<CGLPixelFormatObj> pixel_format; 42 base::ScopedTypeRef<CGLPixelFormatObj> pixel_format;
45 error = CGLChoosePixelFormat(&attribs.front(), 43 error = CGLChoosePixelFormat(&attribs.front(),
46 pixel_format.InitializeInto(), 44 pixel_format.InitializeInto(),
47 &number_virtual_screens); 45 &number_virtual_screens);
48 if (error != kCGLNoError) { 46 if (error != kCGLNoError) {
49 LOG(ERROR) << "Failed to create pixel format object."; 47 LOG(ERROR) << "Failed to create pixel format object.";
50 return NULL; 48 return NULL;
51 } 49 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 IOSurfaceContext::TypeMap* 109 IOSurfaceContext::TypeMap*
112 IOSurfaceContext::type_map() { 110 IOSurfaceContext::type_map() {
113 return type_map_.Pointer(); 111 return type_map_.Pointer();
114 } 112 }
115 113
116 // static 114 // static
117 base::LazyInstance<IOSurfaceContext::TypeMap> 115 base::LazyInstance<IOSurfaceContext::TypeMap>
118 IOSurfaceContext::type_map_; 116 IOSurfaceContext::type_map_;
119 117
120 } // namespace ui 118 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698