OLD | NEW |
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 #include "chrome/gpu/gpu_backing_store_glx_context.h" | 5 #include "chrome/gpu/gpu_backing_store_glx_context.h" |
6 | 6 |
7 #include "app/gfx/gl/gl_bindings.h" | 7 #include "app/gfx/gl/gl_bindings.h" |
8 #include "app/x11_util.h" | 8 #include "app/x11_util.h" |
9 #include "base/scoped_ptr.h" | 9 #include "base/scoped_ptr.h" |
10 #include "chrome/gpu/gpu_thread.h" | 10 #include "chrome/gpu/gpu_thread.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 bool success = glXMakeCurrent(gpu_thread_->display(), window_id, | 45 bool success = glXMakeCurrent(gpu_thread_->display(), window_id, |
46 context_); | 46 context_); |
47 DCHECK(success); | 47 DCHECK(success); |
48 } | 48 } |
49 previous_window_id_ = window_id; | 49 previous_window_id_ = window_id; |
50 return context_; | 50 return context_; |
51 } | 51 } |
52 tried_to_init_ = true; | 52 tried_to_init_ = true; |
53 | 53 |
54 int attrib_list[] = { GLX_RGBA, GLX_DOUBLEBUFFER, 0 }; | 54 int attrib_list[] = { GLX_RGBA, GLX_DOUBLEBUFFER, 0 }; |
55 scoped_ptr_malloc<XVisualInfo, ScopedPtrXFree> visual_info( | 55 scoped_ptr_malloc<XVisualInfo, FreeFnAdapterIgnoreReturn< ::XFree> > visual_in
fo( |
56 glXChooseVisual(gpu_thread_->display(), 0, attrib_list)); | 56 glXChooseVisual(gpu_thread_->display(), 0, attrib_list)); |
57 if (!visual_info.get()) | 57 if (!visual_info.get()) |
58 return NULL; | 58 return NULL; |
59 | 59 |
60 context_ = glXCreateContext(gpu_thread_->display(), visual_info.get(), | 60 context_ = glXCreateContext(gpu_thread_->display(), visual_info.get(), |
61 NULL, True); | 61 NULL, True); |
62 bool success = glXMakeCurrent(gpu_thread_->display(), window_id, context_); | 62 bool success = glXMakeCurrent(gpu_thread_->display(), window_id, context_); |
63 DCHECK(success); | 63 DCHECK(success); |
64 return context_; | 64 return context_; |
65 } | 65 } |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 is_frame_buffer_bound_ = false; | 114 is_frame_buffer_bound_ = false; |
115 | 115 |
116 DCHECK(temp_scroll_texture_id_); | 116 DCHECK(temp_scroll_texture_id_); |
117 unsigned int new_texture = temp_scroll_texture_id_; | 117 unsigned int new_texture = temp_scroll_texture_id_; |
118 | 118 |
119 temp_scroll_texture_id_ = old_texture; | 119 temp_scroll_texture_id_ = old_texture; |
120 temp_scroll_texture_size_ = old_size; | 120 temp_scroll_texture_size_ = old_size; |
121 | 121 |
122 return new_texture; | 122 return new_texture; |
123 } | 123 } |
OLD | NEW |