| 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/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 Loading... |
| 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 |
| OLD | NEW |