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

Side by Side Diff: ui/gl/gl_context_cgl.cc

Issue 14061025: ui: Use base::MessageLoop. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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 | « ui/compositor/test/test_suite.cc ('k') | ui/message_center/views/message_bubble_base.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) 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 "ui/gl/gl_context_cgl.h" 5 #include "ui/gl/gl_context_cgl.h"
6 6
7 #include <OpenGL/CGLRenderers.h> 7 #include <OpenGL/CGLRenderers.h>
8 #include <OpenGL/CGLTypes.h> 8 #include <OpenGL/CGLTypes.h>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 } 105 }
106 106
107 gpu_preference_ = gpu_preference; 107 gpu_preference_ = gpu_preference;
108 return true; 108 return true;
109 } 109 }
110 110
111 void GLContextCGL::Destroy() { 111 void GLContextCGL::Destroy() {
112 if (discrete_pixelformat_) { 112 if (discrete_pixelformat_) {
113 // Delay releasing the pixel format for 10 seconds to reduce the number of 113 // Delay releasing the pixel format for 10 seconds to reduce the number of
114 // unnecessary GPU switches. 114 // unnecessary GPU switches.
115 MessageLoop::current()->PostDelayedTask(FROM_HERE, 115 base::MessageLoop::current()->PostDelayedTask(
116 base::Bind(&CGLReleasePixelFormat, 116 FROM_HERE,
117 discrete_pixelformat_), 117 base::Bind(&CGLReleasePixelFormat, discrete_pixelformat_),
118 base::TimeDelta::FromSeconds(10)); 118 base::TimeDelta::FromSeconds(10));
119 discrete_pixelformat_ = NULL; 119 discrete_pixelformat_ = NULL;
120 } 120 }
121 if (context_) { 121 if (context_) {
122 CGLDestroyContext(static_cast<CGLContextObj>(context_)); 122 CGLDestroyContext(static_cast<CGLContextObj>(context_));
123 context_ = NULL; 123 context_ = NULL;
124 } 124 }
125 } 125 }
126 126
127 bool GLContextCGL::MakeCurrent(GLSurface* surface) { 127 bool GLContextCGL::MakeCurrent(GLSurface* surface) {
128 DCHECK(context_); 128 DCHECK(context_);
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 284
285 GpuPreference GLContextCGL::GetGpuPreference() { 285 GpuPreference GLContextCGL::GetGpuPreference() {
286 return gpu_preference_; 286 return gpu_preference_;
287 } 287 }
288 288
289 void ScopedCGLDestroyRendererInfo::operator()(CGLRendererInfoObj x) const { 289 void ScopedCGLDestroyRendererInfo::operator()(CGLRendererInfoObj x) const {
290 CGLDestroyRendererInfo(x); 290 CGLDestroyRendererInfo(x);
291 } 291 }
292 292
293 } // namespace gfx 293 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/compositor/test/test_suite.cc ('k') | ui/message_center/views/message_bubble_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698