Chromium Code Reviews

Side by Side Diff: gpu/command_buffer/service/gpu_processor_mac.cc

Issue 2782006: Remove duplicated code in AcceleratedSurface using PbufferGLContext instead.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: Address review comments. Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
« no previous file with comments | « app/surface/accelerated_surface_mac.cc ('k') | 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) 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 "app/gfx/gl/gl_context.h" 5 #include "app/gfx/gl/gl_context.h"
6 #include "gpu/command_buffer/service/gpu_processor.h" 6 #include "gpu/command_buffer/service/gpu_processor.h"
7 7
8 using ::base::SharedMemory; 8 using ::base::SharedMemory;
9 9
10 namespace gpu { 10 namespace gpu {
(...skipping 22 matching lines...)
33 return false; 33 return false;
34 34
35 // On Mac OS X since we can not render on-screen we don't even 35 // On Mac OS X since we can not render on-screen we don't even
36 // attempt to create a view based GLContext. The only difference 36 // attempt to create a view based GLContext. The only difference
37 // between "on-screen" and "off-screen" rendering on this platform 37 // between "on-screen" and "off-screen" rendering on this platform
38 // is whether we allocate an AcceleratedSurface, which transmits the 38 // is whether we allocate an AcceleratedSurface, which transmits the
39 // rendering results back to the browser. 39 // rendering results back to the browser.
40 if (window) { 40 if (window) {
41 surface_.reset(new AcceleratedSurface()); 41 surface_.reset(new AcceleratedSurface());
42 // TODO(apatrick): AcceleratedSurface will not work with an OSMesa context. 42 // TODO(apatrick): AcceleratedSurface will not work with an OSMesa context.
43 if (!surface_->Initialize( 43 if (!surface_->Initialize(context_.get(), false)) {
44 static_cast<CGLContextObj>(context_->GetHandle()), false)) {
45 Destroy(); 44 Destroy();
46 return false; 45 return false;
47 } 46 }
48 } 47 }
49 48
50 return InitializeCommon(size, parent_decoder, parent_texture_id); 49 return InitializeCommon(size, parent_decoder, parent_texture_id);
51 50
52 return true; 51 return true;
53 } 52 }
54 53
(...skipping 30 matching lines...)
85 surface_->SwapBuffers(); 84 surface_->SwapBuffers();
86 } 85 }
87 86
88 if (wrapped_swap_buffers_callback_.get()) { 87 if (wrapped_swap_buffers_callback_.get()) {
89 wrapped_swap_buffers_callback_->Run(); 88 wrapped_swap_buffers_callback_->Run();
90 } 89 }
91 } 90 }
92 91
93 } // namespace gpu 92 } // namespace gpu
94 93
OLDNEW
« no previous file with comments | « app/surface/accelerated_surface_mac.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine