OLD | NEW |
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/ganesh_app/texture_uploader.h" | 5 #include "examples/ganesh_app/texture_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 | 9 #endif |
10 | 10 |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 texture_state->background_color->rgba = 0; | 114 texture_state->background_color->rgba = 0; |
115 for (int i = 0; i < 4; ++i) | 115 for (int i = 0; i < 4; ++i) |
116 texture_state->vertex_opacity.push_back(1.f); | 116 texture_state->vertex_opacity.push_back(1.f); |
117 texture_state->flipped = false; | 117 texture_state->flipped = false; |
118 | 118 |
119 frame->resources.push_back(resource.Pass()); | 119 frame->resources.push_back(resource.Pass()); |
120 quad->texture_quad_state = texture_state.Pass(); | 120 quad->texture_quad_state = texture_state.Pass(); |
121 pass->quads.push_back(quad.Pass()); | 121 pass->quads.push_back(quad.Pass()); |
122 | 122 |
123 frame->passes.push_back(pass.Pass()); | 123 frame->passes.push_back(pass.Pass()); |
124 surface_->SubmitFrame(surface_id_.Clone(), frame.Pass()); | 124 surface_->SubmitFrame(surface_id_.Clone(), frame.Pass(), mojo::Closure()); |
125 } | 125 } |
126 | 126 |
127 void TextureUploader::EnsureSurfaceForSize(const mojo::Size& size) { | 127 void TextureUploader::EnsureSurfaceForSize(const mojo::Size& size) { |
128 if (surface_id_ && size == surface_size_) | 128 if (surface_id_ && size == surface_size_) |
129 return; | 129 return; |
130 | 130 |
131 if (surface_id_) { | 131 if (surface_id_) { |
132 surface_->DestroySurface(surface_id_.Clone()); | 132 surface_->DestroySurface(surface_id_.Clone()); |
133 } else { | 133 } else { |
134 surface_id_ = mojo::SurfaceId::New(); | 134 surface_id_ = mojo::SurfaceId::New(); |
(...skipping 30 matching lines...) Expand all Loading... |
165 uint32_t id_namespace) { | 165 uint32_t id_namespace) { |
166 surface_ = surface.Pass(); | 166 surface_ = surface.Pass(); |
167 surface_.set_client(this); | 167 surface_.set_client(this); |
168 id_namespace_ = id_namespace; | 168 id_namespace_ = id_namespace; |
169 | 169 |
170 if (pending_upload_) | 170 if (pending_upload_) |
171 Upload(pending_upload_.Pass()); | 171 Upload(pending_upload_.Pass()); |
172 } | 172 } |
173 | 173 |
174 } // namespace examples | 174 } // namespace examples |
OLD | NEW |