| 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 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 static void ReleaseMailboxCB(const gpu::SyncToken& sync_token) {} | 134 static void ReleaseMailboxCB(const gpu::SyncToken& sync_token) {} |
| 135 | 135 |
| 136 scoped_refptr<media::VideoFrame> CreateTestHardwareVideoFrame( | 136 scoped_refptr<media::VideoFrame> CreateTestHardwareVideoFrame( |
| 137 unsigned target) { | 137 unsigned target) { |
| 138 const int kDimension = 10; | 138 const int kDimension = 10; |
| 139 gfx::Size size(kDimension, kDimension); | 139 gfx::Size size(kDimension, kDimension); |
| 140 | 140 |
| 141 gpu::Mailbox mailbox; | 141 gpu::Mailbox mailbox; |
| 142 mailbox.name[0] = 51; | 142 mailbox.name[0] = 51; |
| 143 | 143 |
| 144 const gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, 0, | 144 const gpu::SyncToken sync_token( |
| 145 0x123, 7); | 145 gpu::CommandBufferNamespace::GPU_IO, 0, |
| 146 gpu::CommandBufferId::FromUnsafeValue(0x123), 7); |
| 146 scoped_refptr<media::VideoFrame> video_frame = | 147 scoped_refptr<media::VideoFrame> video_frame = |
| 147 media::VideoFrame::WrapNativeTexture( | 148 media::VideoFrame::WrapNativeTexture( |
| 148 media::PIXEL_FORMAT_ARGB, | 149 media::PIXEL_FORMAT_ARGB, |
| 149 gpu::MailboxHolder(mailbox, sync_token, target), | 150 gpu::MailboxHolder(mailbox, sync_token, target), |
| 150 base::Bind(&ReleaseMailboxCB), | 151 base::Bind(&ReleaseMailboxCB), |
| 151 size, // coded_size | 152 size, // coded_size |
| 152 gfx::Rect(size), // visible_rect | 153 gfx::Rect(size), // visible_rect |
| 153 size, // natural_size | 154 size, // natural_size |
| 154 base::TimeDelta()); // timestamp | 155 base::TimeDelta()); // timestamp |
| 155 EXPECT_TRUE(video_frame); | 156 EXPECT_TRUE(video_frame); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 171 | 172 |
| 172 scoped_refptr<media::VideoFrame> CreateTestYuvHardwareVideoFrame() { | 173 scoped_refptr<media::VideoFrame> CreateTestYuvHardwareVideoFrame() { |
| 173 const int kDimension = 10; | 174 const int kDimension = 10; |
| 174 gfx::Size size(kDimension, kDimension); | 175 gfx::Size size(kDimension, kDimension); |
| 175 | 176 |
| 176 const int kPlanesNum = 3; | 177 const int kPlanesNum = 3; |
| 177 gpu::Mailbox mailbox[kPlanesNum]; | 178 gpu::Mailbox mailbox[kPlanesNum]; |
| 178 for (int i = 0; i < kPlanesNum; ++i) { | 179 for (int i = 0; i < kPlanesNum; ++i) { |
| 179 mailbox[i].name[0] = 50 + 1; | 180 mailbox[i].name[0] = 50 + 1; |
| 180 } | 181 } |
| 181 const gpu::SyncToken sync_token(gpu::CommandBufferNamespace::GPU_IO, 0, | 182 const gpu::SyncToken sync_token( |
| 182 0x123, 7); | 183 gpu::CommandBufferNamespace::GPU_IO, 0, |
| 184 gpu::CommandBufferId::FromUnsafeValue(0x123), 7); |
| 183 const unsigned target = GL_TEXTURE_RECTANGLE_ARB; | 185 const unsigned target = GL_TEXTURE_RECTANGLE_ARB; |
| 184 scoped_refptr<media::VideoFrame> video_frame = | 186 scoped_refptr<media::VideoFrame> video_frame = |
| 185 media::VideoFrame::WrapYUV420NativeTextures( | 187 media::VideoFrame::WrapYUV420NativeTextures( |
| 186 gpu::MailboxHolder(mailbox[media::VideoFrame::kYPlane], sync_token, | 188 gpu::MailboxHolder(mailbox[media::VideoFrame::kYPlane], sync_token, |
| 187 target), | 189 target), |
| 188 gpu::MailboxHolder(mailbox[media::VideoFrame::kUPlane], sync_token, | 190 gpu::MailboxHolder(mailbox[media::VideoFrame::kUPlane], sync_token, |
| 189 target), | 191 target), |
| 190 gpu::MailboxHolder(mailbox[media::VideoFrame::kVPlane], sync_token, | 192 gpu::MailboxHolder(mailbox[media::VideoFrame::kVPlane], sync_token, |
| 191 target), | 193 target), |
| 192 base::Bind(&ReleaseMailboxCB), | 194 base::Bind(&ReleaseMailboxCB), |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 | 402 |
| 401 // The texture copy path requires the use of CopyTextureCHROMIUM, which | 403 // The texture copy path requires the use of CopyTextureCHROMIUM, which |
| 402 // enforces that the target texture not be immutable, as it may need | 404 // enforces that the target texture not be immutable, as it may need |
| 403 // to alter the storage of the texture. Therefore, this test asserts | 405 // to alter the storage of the texture. Therefore, this test asserts |
| 404 // that an immutable texture wasn't created by glTexStorage2DEXT, when | 406 // that an immutable texture wasn't created by glTexStorage2DEXT, when |
| 405 // that extension is supported. | 407 // that extension is supported. |
| 406 EXPECT_FALSE(context3d_->WasImmutableTextureCreated()); | 408 EXPECT_FALSE(context3d_->WasImmutableTextureCreated()); |
| 407 } | 409 } |
| 408 } // namespace | 410 } // namespace |
| 409 } // namespace cc | 411 } // namespace cc |
| OLD | NEW |