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

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

Issue 7021014: GLContext no longer holds a pointer to a GLSurface. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 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 <windows.h> 5 #include <windows.h>
6 6
7 #include "gpu/command_buffer/service/gpu_scheduler.h" 7 #include "gpu/command_buffer/service/gpu_scheduler.h"
8 #include "ui/gfx/gl/gl_context.h" 8 #include "ui/gfx/gl/gl_context.h"
9 #include "ui/gfx/gl/gl_surface.h" 9 #include "ui/gfx/gl/gl_surface.h"
10 10
(...skipping 29 matching lines...) Expand all
40 } 40 }
41 41
42 if (!surface.get()) { 42 if (!surface.get()) {
43 LOG(ERROR) << "GpuScheduler::Initialize failed.\n"; 43 LOG(ERROR) << "GpuScheduler::Initialize failed.\n";
44 Destroy(); 44 Destroy();
45 return false; 45 return false;
46 } 46 }
47 47
48 // Create a GLContext and attach the surface. 48 // Create a GLContext and attach the surface.
49 scoped_ptr<gfx::GLContext> context( 49 scoped_ptr<gfx::GLContext> context(
50 gfx::GLContext::CreateGLContext(surface.release(), parent_context)); 50 gfx::GLContext::CreateGLContext(parent_context, surface.get()));
51 if (!context.get()) { 51 if (!context.get()) {
52 LOG(ERROR) << "CreateGLContext failed.\n"; 52 LOG(ERROR) << "CreateGLContext failed.\n";
53 Destroy(); 53 Destroy();
54 return false; 54 return false;
55 } 55 }
56 56
57 return InitializeCommon(context.release(), 57 return InitializeCommon(surface.release(),
58 context.release(),
58 size, 59 size,
59 disallowed_extensions, 60 disallowed_extensions,
60 allowed_extensions, 61 allowed_extensions,
61 attribs, 62 attribs,
62 parent_decoder, 63 parent_decoder,
63 parent_texture_id); 64 parent_texture_id);
64 } 65 }
65 66
66 void GpuScheduler::Destroy() { 67 void GpuScheduler::Destroy() {
67 DestroyCommon(); 68 DestroyCommon();
68 } 69 }
69 70
70 void GpuScheduler::WillSwapBuffers() { 71 void GpuScheduler::WillSwapBuffers() {
71 if (wrapped_swap_buffers_callback_.get()) { 72 if (wrapped_swap_buffers_callback_.get()) {
72 wrapped_swap_buffers_callback_->Run(); 73 wrapped_swap_buffers_callback_->Run();
73 } 74 }
74 } 75 }
75 76
76 } // namespace gpu 77 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698