OLD | NEW |
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 <GLES2/gl2.h> | 5 #include <GLES2/gl2.h> |
6 | 6 |
7 #include "gpu/demos/framework/demo.h" | 7 #include "gpu/demos/framework/demo.h" |
8 #include "gpu/demos/framework/demo_factory.h" | 8 #include "gpu/demos/framework/demo_factory.h" |
9 #include "ppapi/cpp/completion_callback.h" | 9 #include "ppapi/cpp/completion_callback.h" |
10 #include "ppapi/cpp/instance.h" | 10 #include "ppapi/cpp/instance.h" |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 int32_t attribs[] = { | 81 int32_t attribs[] = { |
82 PP_GRAPHICS3DATTRIB_ALPHA_SIZE, 8, | 82 PP_GRAPHICS3DATTRIB_ALPHA_SIZE, 8, |
83 PP_GRAPHICS3DATTRIB_DEPTH_SIZE, 24, | 83 PP_GRAPHICS3DATTRIB_DEPTH_SIZE, 24, |
84 PP_GRAPHICS3DATTRIB_STENCIL_SIZE, 8, | 84 PP_GRAPHICS3DATTRIB_STENCIL_SIZE, 8, |
85 PP_GRAPHICS3DATTRIB_SAMPLES, 0, | 85 PP_GRAPHICS3DATTRIB_SAMPLES, 0, |
86 PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS, 0, | 86 PP_GRAPHICS3DATTRIB_SAMPLE_BUFFERS, 0, |
87 PP_GRAPHICS3DATTRIB_WIDTH, size_.width(), | 87 PP_GRAPHICS3DATTRIB_WIDTH, size_.width(), |
88 PP_GRAPHICS3DATTRIB_HEIGHT, size_.height(), | 88 PP_GRAPHICS3DATTRIB_HEIGHT, size_.height(), |
89 PP_GRAPHICS3DATTRIB_NONE | 89 PP_GRAPHICS3DATTRIB_NONE |
90 }; | 90 }; |
91 context_ = pp::Graphics3D_Dev(*this, 0, pp::Graphics3D_Dev(), attribs); | 91 context_ = pp::Graphics3D_Dev(*this, pp::Graphics3D_Dev(), attribs); |
92 if (context_.is_null()) | 92 if (context_.is_null()) |
93 return; | 93 return; |
94 | 94 |
95 pp::Instance::BindGraphics(context_); | 95 pp::Instance::BindGraphics(context_); |
96 | 96 |
97 glSetCurrentContextPPAPI(context_.pp_resource()); | 97 glSetCurrentContextPPAPI(context_.pp_resource()); |
98 demo_->InitGL(); | 98 demo_->InitGL(); |
99 demo_->Resize(size_.width(), size_.height()); | 99 demo_->Resize(size_.width(), size_.height()); |
100 glSetCurrentContextPPAPI(0); | 100 glSetCurrentContextPPAPI(0); |
101 } | 101 } |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } // namespace gpu | 138 } // namespace gpu |
139 | 139 |
140 namespace pp { | 140 namespace pp { |
141 | 141 |
142 Module* CreateModule() { | 142 Module* CreateModule() { |
143 return new gpu::demos::PluginModule(); | 143 return new gpu::demos::PluginModule(); |
144 } | 144 } |
145 | 145 |
146 } // namespace pp | 146 } // namespace pp |
147 | 147 |
OLD | NEW |