OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2013 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 #include "webrtc/test/win/d3d_renderer.h" | 10 #include "webrtc/test/win/d3d_renderer.h" |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 if (static_cast<size_t>(frame.width()) != width_ || | 196 if (static_cast<size_t>(frame.width()) != width_ || |
197 static_cast<size_t>(frame.height()) != height_) { | 197 static_cast<size_t>(frame.height()) != height_) { |
198 Resize(static_cast<size_t>(frame.width()), | 198 Resize(static_cast<size_t>(frame.width()), |
199 static_cast<size_t>(frame.height())); | 199 static_cast<size_t>(frame.height())); |
200 } | 200 } |
201 | 201 |
202 D3DLOCKED_RECT lock_rect; | 202 D3DLOCKED_RECT lock_rect; |
203 if (texture_->LockRect(0, &lock_rect, NULL, 0) != D3D_OK) | 203 if (texture_->LockRect(0, &lock_rect, NULL, 0) != D3D_OK) |
204 return; | 204 return; |
205 | 205 |
206 ConvertFromI420(frame, kARGB, 0, static_cast<uint8_t*>(lock_rect.pBits)); | 206 ConvertFromI420(frame, VideoType::kARGB, 0, |
| 207 static_cast<uint8_t*>(lock_rect.pBits)); |
207 texture_->UnlockRect(0); | 208 texture_->UnlockRect(0); |
208 | 209 |
209 d3d_device_->BeginScene(); | 210 d3d_device_->BeginScene(); |
210 d3d_device_->SetFVF(D3DFVF_CUSTOMVERTEX); | 211 d3d_device_->SetFVF(D3DFVF_CUSTOMVERTEX); |
211 d3d_device_->SetStreamSource(0, vertex_buffer_, 0, sizeof(D3dCustomVertex)); | 212 d3d_device_->SetStreamSource(0, vertex_buffer_, 0, sizeof(D3dCustomVertex)); |
212 d3d_device_->SetTexture(0, texture_); | 213 d3d_device_->SetTexture(0, texture_); |
213 d3d_device_->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); | 214 d3d_device_->DrawPrimitive(D3DPT_TRIANGLESTRIP, 0, 2); |
214 d3d_device_->EndScene(); | 215 d3d_device_->EndScene(); |
215 | 216 |
216 d3d_device_->Present(NULL, NULL, NULL, NULL); | 217 d3d_device_->Present(NULL, NULL, NULL, NULL); |
217 } | 218 } |
218 } // namespace test | 219 } // namespace test |
219 } // namespace webrtc | 220 } // namespace webrtc |
OLD | NEW |