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

Side by Side Diff: gpu/demos/framework/window.cc

Issue 8566059: Add CommandBuffer::SetGetBuffer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: etc Created 9 years, 1 month 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 "gpu/demos/framework/window.h" 5 #include "gpu/demos/framework/window.h"
6 6
7 #include "base/callback.h" 7 #include "base/callback.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "base/memory/scoped_ptr.h" 9 #include "base/memory/scoped_ptr.h"
10 #include "gpu/command_buffer/client/gles2_implementation.h" 10 #include "gpu/command_buffer/client/gles2_implementation.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 return demo_->InitGL(); 46 return demo_->InitGL();
47 } 47 }
48 48
49 void Window::OnPaint() { 49 void Window::OnPaint() {
50 demo_->Draw(); 50 demo_->Draw();
51 ::gles2::GetGLContext()->SwapBuffers(); 51 ::gles2::GetGLContext()->SwapBuffers();
52 } 52 }
53 53
54 bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) { 54 bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) {
55 command_buffer_.reset(new CommandBufferService); 55 command_buffer_.reset(new CommandBufferService);
56 if (!command_buffer_->Initialize(kCommandBufferSize)) { 56 if (!command_buffer_->Initialize()) {
57 return false; 57 return false;
58 } 58 }
59 59
60 gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(true)); 60 gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(true));
61 61
62 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); 62 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get()));
63 if (!decoder_.get()) 63 if (!decoder_.get())
64 return false; 64 return false;
65 65
66 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), 66 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(),
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 transfer_buffer.size, 106 transfer_buffer.size,
107 transfer_buffer.ptr, 107 transfer_buffer.ptr,
108 transfer_buffer_id, 108 transfer_buffer_id,
109 false, 109 false,
110 true)); 110 true));
111 return true; 111 return true;
112 } 112 }
113 113
114 } // namespace demos 114 } // namespace demos
115 } // namespace gpu 115 } // namespace gpu
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698