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

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

Issue 8919014: Revert "Revert 113479 - Revert "Revert 113250 - Add CommandBuffer::SetGetBuffer"" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years 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/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/memory/ref_counted.h" 9 #include "base/memory/ref_counted.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return demo_->InitGL(); 47 return demo_->InitGL();
48 } 48 }
49 49
50 void Window::OnPaint() { 50 void Window::OnPaint() {
51 demo_->Draw(); 51 demo_->Draw();
52 ::gles2::GetGLContext()->SwapBuffers(); 52 ::gles2::GetGLContext()->SwapBuffers();
53 } 53 }
54 54
55 bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) { 55 bool Window::CreateRenderContext(gfx::PluginWindowHandle hwnd) {
56 command_buffer_.reset(new CommandBufferService); 56 command_buffer_.reset(new CommandBufferService);
57 if (!command_buffer_->Initialize(kCommandBufferSize)) { 57 if (!command_buffer_->Initialize()) {
58 return false; 58 return false;
59 } 59 }
60 60
61 gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(true)); 61 gpu::gles2::ContextGroup::Ref group(new gpu::gles2::ContextGroup(true));
62 62
63 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get())); 63 decoder_.reset(gpu::gles2::GLES2Decoder::Create(group.get()));
64 if (!decoder_.get()) 64 if (!decoder_.get())
65 return false; 65 return false;
66 66
67 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(), 67 gpu_scheduler_.reset(new gpu::GpuScheduler(command_buffer_.get(),
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 transfer_buffer.size, 108 transfer_buffer.size,
109 transfer_buffer.ptr, 109 transfer_buffer.ptr,
110 transfer_buffer_id, 110 transfer_buffer_id,
111 false, 111 false,
112 true)); 112 true));
113 return true; 113 return true;
114 } 114 }
115 115
116 } // namespace demos 116 } // namespace demos
117 } // namespace gpu 117 } // namespace gpu
OLDNEW
« no previous file with comments | « gpu/command_buffer/service/gpu_scheduler_unittest.cc ('k') | gpu/gles2_conform_support/egl/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698