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

Side by Side Diff: examples/bitmap_uploader/bitmap_uploader.cc

Issue 756673004: Surfaces should acknowledge frame submissions (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "examples/bitmap_uploader/bitmap_uploader.h" 5 #include "examples/bitmap_uploader/bitmap_uploader.h"
6 6
7 #ifndef GL_GLEXT_PROTOTYPES 7 #ifndef GL_GLEXT_PROTOTYPES
8 #define GL_GLEXT_PROTOTYPES 8 #define GL_GLEXT_PROTOTYPES
9 #endif // GL_GLEXT_PROTOTYPES 9 #endif // GL_GLEXT_PROTOTYPES
10 10
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 color_state->color = Color::New(); 215 color_state->color = Color::New();
216 color_state->color->rgba = color_; 216 color_state->color->rgba = color_;
217 color_state->force_anti_aliasing_off = false; 217 color_state->force_anti_aliasing_off = false;
218 218
219 quad->solid_color_quad_state = color_state.Pass(); 219 quad->solid_color_quad_state = color_state.Pass();
220 pass->quads.push_back(quad.Pass()); 220 pass->quads.push_back(quad.Pass());
221 } 221 }
222 222
223 frame->passes.push_back(pass.Pass()); 223 frame->passes.push_back(pass.Pass());
224 224
225 surface_->SubmitFrame(surface_id_.Clone(), frame.Pass()); 225 surface_->SubmitFrame(surface_id_.Clone(), frame.Pass(), mojo::Closure());
226 } 226 }
227 227
228 void BitmapUploader::ReturnResources(Array<ReturnedResourcePtr> resources) { 228 void BitmapUploader::ReturnResources(Array<ReturnedResourcePtr> resources) {
229 if (!resources.size()) 229 if (!resources.size())
230 return; 230 return;
231 MojoGLES2MakeCurrent(gles2_context_); 231 MojoGLES2MakeCurrent(gles2_context_);
232 // TODO(jamesr): Recycle. 232 // TODO(jamesr): Recycle.
233 for (size_t i = 0; i < resources.size(); ++i) { 233 for (size_t i = 0; i < resources.size(); ++i) {
234 ReturnedResourcePtr resource = resources[i].Pass(); 234 ReturnedResourcePtr resource = resources[i].Pass();
235 DCHECK_EQ(1, resource->count); 235 DCHECK_EQ(1, resource->count);
(...skipping 30 matching lines...) Expand all
266 0); 266 0);
267 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); 267 glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
268 return texture; 268 return texture;
269 } 269 }
270 270
271 uint32_t BitmapUploader::TextureFormat() { 271 uint32_t BitmapUploader::TextureFormat() {
272 return format_ == BGRA ? GL_BGRA_EXT : GL_RGBA; 272 return format_ == BGRA ? GL_BGRA_EXT : GL_RGBA;
273 } 273 }
274 274
275 } // namespace mojo 275 } // namespace mojo
OLDNEW
« no previous file with comments | « no previous file | examples/ganesh_app/texture_uploader.cc » ('j') | mojo/services/public/interfaces/surfaces/surfaces.mojom » ('J')

Powered by Google App Engine
This is Rietveld 408576698