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

Side by Side Diff: examples/surfaces_app/child_gl_impl.cc

Issue 783543003: Update from https://crrev.com/306901 (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
« no previous file with comments | « crypto/p224_spake_unittest.cc ('k') | gpu/GLES2/OWNERS » ('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 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/surfaces_app/child_gl_impl.h" 5 #include "examples/surfaces_app/child_gl_impl.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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 gfx::Rect rect(size_); 151 gfx::Rect rect(size_);
152 RenderPassId id(1, 1); 152 RenderPassId id(1, 1);
153 scoped_ptr<RenderPass> pass = RenderPass::Create(); 153 scoped_ptr<RenderPass> pass = RenderPass::Create();
154 pass->SetNew(id, rect, rect, gfx::Transform()); 154 pass->SetNew(id, rect, rect, gfx::Transform());
155 155
156 CreateAndAppendSimpleSharedQuadState(pass.get(), gfx::Transform(), size_); 156 CreateAndAppendSimpleSharedQuadState(pass.get(), gfx::Transform(), size_);
157 157
158 TextureDrawQuad* texture_quad = 158 TextureDrawQuad* texture_quad =
159 pass->CreateAndAppendDrawQuad<TextureDrawQuad>(); 159 pass->CreateAndAppendDrawQuad<TextureDrawQuad>();
160 float vertex_opacity[4] = {1.0f, 1.0f, 0.2f, 1.0f}; 160 float vertex_opacity[4] = {1.0f, 1.0f, 0.2f, 1.0f};
161 const bool premultiplied_alpha = true;
162 const bool flipped = false;
163 const bool nearest_neighbor = false;
161 texture_quad->SetNew(pass->shared_quad_state_list.back(), 164 texture_quad->SetNew(pass->shared_quad_state_list.back(),
162 rect, 165 rect,
163 rect, 166 rect,
164 rect, 167 rect,
165 resource.id, 168 resource.id,
166 true, 169 premultiplied_alpha,
167 gfx::PointF(), 170 gfx::PointF(),
168 gfx::PointF(1.f, 1.f), 171 gfx::PointF(1.f, 1.f),
169 SK_ColorBLUE, 172 SK_ColorBLUE,
170 vertex_opacity, 173 vertex_opacity,
171 false); 174 flipped,
175 nearest_neighbor);
172 176
173 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData); 177 scoped_ptr<DelegatedFrameData> delegated_frame_data(new DelegatedFrameData);
174 delegated_frame_data->render_pass_list.push_back(pass.Pass()); 178 delegated_frame_data->render_pass_list.push_back(pass.Pass());
175 delegated_frame_data->resource_list.push_back(resource); 179 delegated_frame_data->resource_list.push_back(resource);
176 180
177 scoped_ptr<CompositorFrame> frame(new CompositorFrame); 181 scoped_ptr<CompositorFrame> frame(new CompositorFrame);
178 frame->delegated_frame_data = delegated_frame_data.Pass(); 182 frame->delegated_frame_data = delegated_frame_data.Pass();
179 183
180 surface_->SubmitFrame(mojo::SurfaceId::From(id_), mojo::Frame::From(*frame), 184 surface_->SubmitFrame(mojo::SurfaceId::From(id_), mojo::Frame::From(*frame),
181 mojo::Closure()); 185 mojo::Closure());
182 186
183 base::MessageLoop::current()->PostDelayedTask( 187 base::MessageLoop::current()->PostDelayedTask(
184 FROM_HERE, 188 FROM_HERE,
185 base::Bind(&ChildGLImpl::Draw, base::Unretained(this)), 189 base::Bind(&ChildGLImpl::Draw, base::Unretained(this)),
186 base::TimeDelta::FromMilliseconds(50)); 190 base::TimeDelta::FromMilliseconds(50));
187 } 191 }
188 192
189 } // namespace examples 193 } // namespace examples
190 } // namespace mojo 194 } // namespace mojo
OLDNEW
« no previous file with comments | « crypto/p224_spake_unittest.cc ('k') | gpu/GLES2/OWNERS » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698