OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "cc/resources/video_resource_updater.h" | 5 #include "cc/resources/video_resource_updater.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "cc/resources/resource_provider.h" | 10 #include "cc/resources/resource_provider.h" |
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 static void ReleaseMailboxCB(const gpu::SyncToken& sync_token) {} | 175 static void ReleaseMailboxCB(const gpu::SyncToken& sync_token) {} |
176 | 176 |
177 scoped_refptr<media::VideoFrame> CreateTestHardwareVideoFrame( | 177 scoped_refptr<media::VideoFrame> CreateTestHardwareVideoFrame( |
178 unsigned target) { | 178 unsigned target) { |
179 const int kDimension = 10; | 179 const int kDimension = 10; |
180 gfx::Size size(kDimension, kDimension); | 180 gfx::Size size(kDimension, kDimension); |
181 | 181 |
182 gpu::Mailbox mailbox; | 182 gpu::Mailbox mailbox; |
183 mailbox.name[0] = 51; | 183 mailbox.name[0] = 51; |
184 | 184 |
185 const gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, 0, | 185 const gpu::SyncToken sync_token( |
186 0x123, 7); | 186 gpu::CommandBufferNamespace::GPU_IO, 0, |
| 187 gpu::CommandBufferId::FromUnsafeValue(0x123), 7); |
187 scoped_refptr<media::VideoFrame> video_frame = | 188 scoped_refptr<media::VideoFrame> video_frame = |
188 media::VideoFrame::WrapNativeTexture( | 189 media::VideoFrame::WrapNativeTexture( |
189 media::PIXEL_FORMAT_ARGB, | 190 media::PIXEL_FORMAT_ARGB, |
190 gpu::MailboxHolder(mailbox, sync_token, target), | 191 gpu::MailboxHolder(mailbox, sync_token, target), |
191 base::Bind(&ReleaseMailboxCB), | 192 base::Bind(&ReleaseMailboxCB), |
192 size, // coded_size | 193 size, // coded_size |
193 gfx::Rect(size), // visible_rect | 194 gfx::Rect(size), // visible_rect |
194 size, // natural_size | 195 size, // natural_size |
195 base::TimeDelta()); // timestamp | 196 base::TimeDelta()); // timestamp |
196 EXPECT_TRUE(video_frame); | 197 EXPECT_TRUE(video_frame); |
(...skipping 15 matching lines...) Expand all Loading... |
212 | 213 |
213 scoped_refptr<media::VideoFrame> CreateTestYuvHardwareVideoFrame() { | 214 scoped_refptr<media::VideoFrame> CreateTestYuvHardwareVideoFrame() { |
214 const int kDimension = 10; | 215 const int kDimension = 10; |
215 gfx::Size size(kDimension, kDimension); | 216 gfx::Size size(kDimension, kDimension); |
216 | 217 |
217 const int kPlanesNum = 3; | 218 const int kPlanesNum = 3; |
218 gpu::Mailbox mailbox[kPlanesNum]; | 219 gpu::Mailbox mailbox[kPlanesNum]; |
219 for (int i = 0; i < kPlanesNum; ++i) { | 220 for (int i = 0; i < kPlanesNum; ++i) { |
220 mailbox[i].name[0] = 50 + 1; | 221 mailbox[i].name[0] = 50 + 1; |
221 } | 222 } |
222 const gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, 0, | 223 const gpu::SyncToken sync_token( |
223 0x123, 7); | 224 gpu::CommandBufferNamespace::GPU_IO, 0, |
| 225 gpu::CommandBufferId::FromUnsafeValue(0x123), 7); |
224 const unsigned target = GL_TEXTURE_RECTANGLE_ARB; | 226 const unsigned target = GL_TEXTURE_RECTANGLE_ARB; |
225 scoped_refptr<media::VideoFrame> video_frame = | 227 scoped_refptr<media::VideoFrame> video_frame = |
226 media::VideoFrame::WrapYUV420NativeTextures( | 228 media::VideoFrame::WrapYUV420NativeTextures( |
227 gpu::MailboxHolder(mailbox[media::VideoFrame::kYPlane], sync_token, | 229 gpu::MailboxHolder(mailbox[media::VideoFrame::kYPlane], sync_token, |
228 target), | 230 target), |
229 gpu::MailboxHolder(mailbox[media::VideoFrame::kUPlane], sync_token, | 231 gpu::MailboxHolder(mailbox[media::VideoFrame::kUPlane], sync_token, |
230 target), | 232 target), |
231 gpu::MailboxHolder(mailbox[media::VideoFrame::kVPlane], sync_token, | 233 gpu::MailboxHolder(mailbox[media::VideoFrame::kVPlane], sync_token, |
232 target), | 234 target), |
233 base::Bind(&ReleaseMailboxCB), | 235 base::Bind(&ReleaseMailboxCB), |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 // The texture copy path requires the use of CopyTextureCHROMIUM, which | 499 // The texture copy path requires the use of CopyTextureCHROMIUM, which |
498 // enforces that the target texture not be immutable, as it may need | 500 // enforces that the target texture not be immutable, as it may need |
499 // to alter the storage of the texture. Therefore, this test asserts | 501 // to alter the storage of the texture. Therefore, this test asserts |
500 // that an immutable texture wasn't created by glTexStorage2DEXT, when | 502 // that an immutable texture wasn't created by glTexStorage2DEXT, when |
501 // that extension is supported. | 503 // that extension is supported. |
502 EXPECT_FALSE(context3d_->WasImmutableTextureCreated()); | 504 EXPECT_FALSE(context3d_->WasImmutableTextureCreated()); |
503 } | 505 } |
504 | 506 |
505 } // namespace | 507 } // namespace |
506 } // namespace cc | 508 } // namespace cc |
OLD | NEW |