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

Side by Side Diff: apps/moterm/gl_helper.cc

Issue 1375313006: For c++, Generate enum classes instead of enum from mojom. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | apps/moterm/gl_helper_test_app.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "apps/moterm/gl_helper.h" 5 #include "apps/moterm/gl_helper.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 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 mojo::FramePtr frame = mojo::Frame::New(); 101 mojo::FramePtr frame = mojo::Frame::New();
102 102
103 // Frame resources: 103 // Frame resources:
104 frame->resources.push_back(mojo::TransferableResource::New()); 104 frame->resources.push_back(mojo::TransferableResource::New());
105 mojo::TransferableResource* resource = frame->resources[0].get(); 105 mojo::TransferableResource* resource = frame->resources[0].get();
106 resource->id = next_resource_id_++; 106 resource->id = next_resource_id_++;
107 textures_pending_return_.push_back( 107 textures_pending_return_.push_back(
108 TextureInfo(resource->id, frame_texture_, current_surface_size_)); 108 TextureInfo(resource->id, frame_texture_, current_surface_size_));
109 frame_texture_ = 0; 109 frame_texture_ = 0;
110 // TODO(vtl): This is wrong, but doesn't seem to have an effect. 110 // TODO(vtl): This is wrong, but doesn't seem to have an effect.
111 resource->format = mojo::RESOURCE_FORMAT_RGBA_8888; 111 resource->format = mojo::ResourceFormat::RGBA_8888;
112 resource->filter = GL_LINEAR; 112 resource->filter = GL_LINEAR;
113 resource->size = current_surface_size_.Clone(); 113 resource->size = current_surface_size_.Clone();
114 mojo::MailboxHolderPtr mailbox_holder = mojo::MailboxHolder::New(); 114 mojo::MailboxHolderPtr mailbox_holder = mojo::MailboxHolder::New();
115 mailbox_holder->mailbox = mojo::Mailbox::New(); 115 mailbox_holder->mailbox = mojo::Mailbox::New();
116 for (int i = 0; i < GL_MAILBOX_SIZE_CHROMIUM; ++i) 116 for (int i = 0; i < GL_MAILBOX_SIZE_CHROMIUM; ++i)
117 mailbox_holder->mailbox->name.push_back(mailbox[i]); 117 mailbox_holder->mailbox->name.push_back(mailbox[i]);
118 mailbox_holder->texture_target = GL_TEXTURE_2D; 118 mailbox_holder->texture_target = GL_TEXTURE_2D;
119 mailbox_holder->sync_point = sync_point; 119 mailbox_holder->sync_point = sync_point;
120 resource->mailbox_holder = mailbox_holder.Pass(); 120 resource->mailbox_holder = mailbox_holder.Pass();
121 resource->is_repeated = false; 121 resource->is_repeated = false;
122 resource->is_software = false; 122 resource->is_software = false;
123 123
124 // Frame passes: 124 // Frame passes:
125 frame->passes.push_back(mojo::CreateDefaultPass(1, size_rect)); 125 frame->passes.push_back(mojo::CreateDefaultPass(1, size_rect));
126 mojo::Pass* pass = frame->passes[0].get(); 126 mojo::Pass* pass = frame->passes[0].get();
127 pass->quads.push_back(mojo::Quad::New()); 127 pass->quads.push_back(mojo::Quad::New());
128 mojo::Quad* quad = pass->quads[0].get(); 128 mojo::Quad* quad = pass->quads[0].get();
129 quad->material = mojo::MATERIAL_TEXTURE_CONTENT; 129 quad->material = mojo::Material::TEXTURE_CONTENT;
130 quad->rect = size_rect.Clone(); 130 quad->rect = size_rect.Clone();
131 quad->opaque_rect = size_rect.Clone(); 131 quad->opaque_rect = size_rect.Clone();
132 quad->visible_rect = size_rect.Clone(); 132 quad->visible_rect = size_rect.Clone();
133 quad->needs_blending = true; 133 quad->needs_blending = true;
134 quad->shared_quad_state_index = 0; 134 quad->shared_quad_state_index = 0;
135 quad->texture_quad_state = mojo::TextureQuadState::New(); 135 quad->texture_quad_state = mojo::TextureQuadState::New();
136 mojo::TextureQuadState* texture_state = quad->texture_quad_state.get(); 136 mojo::TextureQuadState* texture_state = quad->texture_quad_state.get();
137 texture_state->resource_id = resource->id; 137 texture_state->resource_id = resource->id;
138 texture_state->premultiplied_alpha = true; 138 texture_state->premultiplied_alpha = true;
139 texture_state->uv_top_left = mojo::PointF::New(); 139 texture_state->uv_top_left = mojo::PointF::New();
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 textures_pending_return_.clear(); 318 textures_pending_return_.clear();
319 319
320 // We're in a callback, so we can just call the client directly. 320 // We're in a callback, so we can just call the client directly.
321 client_->OnContextLost(); 321 client_->OnContextLost();
322 } 322 }
323 323
324 void GlHelper::SubmitFrameCallback(uint32_t frame_id) { 324 void GlHelper::SubmitFrameCallback(uint32_t frame_id) {
325 // We're in a callback, so we can just call the client directly. 325 // We're in a callback, so we can just call the client directly.
326 client_->OnFrameDisplayed(frame_id); 326 client_->OnFrameDisplayed(frame_id);
327 } 327 }
OLDNEW
« no previous file with comments | « no previous file | apps/moterm/gl_helper_test_app.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698