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

Side by Side Diff: chrome/renderer/ggl/ggl.cc

Issue 1328001: Added command buffer implementation of WebGL which runs in the sandbox.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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) 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "base/ref_counted.h" 7 #include "base/ref_counted.h"
8 #include "base/singleton.h" 8 #include "base/singleton.h"
9 #include "base/thread_local.h" 9 #include "base/thread_local.h"
10 #include "chrome/renderer/command_buffer_proxy.h" 10 #include "chrome/renderer/command_buffer_proxy.h"
11 #include "chrome/renderer/ggl/ggl.h" 11 #include "chrome/renderer/ggl/ggl.h"
12 #include "chrome/renderer/gpu_channel_host.h" 12 #include "chrome/renderer/gpu_channel_host.h"
13 #include "chrome/renderer/render_widget.h" 13 #include "chrome/renderer/render_widget.h"
14 #include "ipc/ipc_channel_handle.h" 14 #include "ipc/ipc_channel_handle.h"
15 15
16 #if defined(ENABLE_GPU) 16 #if defined(ENABLE_GPU)
17 #include "gpu/command_buffer/client/gles2_cmd_helper.h" 17 #include "gpu/command_buffer/client/gles2_cmd_helper.h"
18 #include "gpu/command_buffer/client/gles2_implementation.h" 18 #include "gpu/command_buffer/client/gles2_implementation.h"
19 #include "gpu/command_buffer/client/gles2_lib.h" 19 #include "gpu/command_buffer/client/gles2_lib.h"
20 #include "gpu/command_buffer/common/constants.h" 20 #include "gpu/command_buffer/common/constants.h"
21 #endif // ENABLE_GPU 21 #endif // ENABLE_GPU
22 22
23 namespace ggl { 23 namespace ggl {
24 24
25 #if defined(ENABLE_GPU) 25 #if defined(ENABLE_GPU)
26 26
27 namespace { 27 namespace {
28 28
29 const int32 kCommandBufferSize = 1024 * 1024; 29 const int32 kCommandBufferSize = 1024 * 1024;
30 // TODO(kbr): make the transfer buffer size configurable via context
31 // creation attributes.
30 const int32 kTransferBufferSize = 1024 * 1024; 32 const int32 kTransferBufferSize = 1024 * 1024;
31 33
32 base::ThreadLocalPointer<Context> g_current_context; 34 base::ThreadLocalPointer<Context> g_current_context;
33 35
34 // Singleton used to initialize and terminate the gles2 library. 36 // Singleton used to initialize and terminate the gles2 library.
35 class GLES2Initializer { 37 class GLES2Initializer {
36 public: 38 public:
37 GLES2Initializer() { 39 GLES2Initializer() {
38 gles2::Initialize(); 40 gles2::Initialize();
39 } 41 }
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
336 if (!context) 338 if (!context)
337 return BAD_CONTEXT; 339 return BAD_CONTEXT;
338 340
339 return context->GetError(); 341 return context->GetError();
340 #else 342 #else
341 return NOT_INITIALIZED; 343 return NOT_INITIALIZED;
342 #endif 344 #endif
343 } 345 }
344 346
345 } // namespace ggl 347 } // namespace ggl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698