OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_base.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1380 AddExpectationsForSimulatedAttrib0WithError( | 1380 AddExpectationsForSimulatedAttrib0WithError( |
1381 num_vertices, buffer_id, GL_NO_ERROR); | 1381 num_vertices, buffer_id, GL_NO_ERROR); |
1382 } | 1382 } |
1383 | 1383 |
1384 GLES2DecoderWithShaderTestBase::MockCommandBufferEngine:: | 1384 GLES2DecoderWithShaderTestBase::MockCommandBufferEngine:: |
1385 MockCommandBufferEngine() { | 1385 MockCommandBufferEngine() { |
1386 data_.reset(new int8[kSharedBufferSize]); | 1386 data_.reset(new int8[kSharedBufferSize]); |
1387 ClearSharedMemory(); | 1387 ClearSharedMemory(); |
1388 valid_buffer_.ptr = data_.get(); | 1388 valid_buffer_.ptr = data_.get(); |
1389 valid_buffer_.size = kSharedBufferSize; | 1389 valid_buffer_.size = kSharedBufferSize; |
| 1390 valid_image_ = gfx::GLImage::CreateGLImage(0); |
1390 } | 1391 } |
1391 | 1392 |
1392 GLES2DecoderWithShaderTestBase::MockCommandBufferEngine:: | 1393 GLES2DecoderWithShaderTestBase::MockCommandBufferEngine:: |
1393 ~MockCommandBufferEngine() {} | 1394 ~MockCommandBufferEngine() {} |
1394 | 1395 |
1395 gpu::Buffer | 1396 gpu::Buffer |
1396 GLES2DecoderWithShaderTestBase::MockCommandBufferEngine::GetSharedMemoryBuffer( | 1397 GLES2DecoderWithShaderTestBase::MockCommandBufferEngine::GetSharedMemoryBuffer( |
1397 int32 shm_id) { | 1398 int32 shm_id) { |
1398 return shm_id == kSharedMemoryId ? valid_buffer_ : invalid_buffer_; | 1399 return shm_id == kSharedMemoryId ? valid_buffer_ : invalid_buffer_; |
1399 } | 1400 } |
(...skipping 13 matching lines...) Expand all Loading... |
1413 int32 offset) { | 1414 int32 offset) { |
1414 DCHECK(false); | 1415 DCHECK(false); |
1415 return false; | 1416 return false; |
1416 } | 1417 } |
1417 | 1418 |
1418 int32 GLES2DecoderWithShaderTestBase::MockCommandBufferEngine::GetGetOffset() { | 1419 int32 GLES2DecoderWithShaderTestBase::MockCommandBufferEngine::GetGetOffset() { |
1419 DCHECK(false); | 1420 DCHECK(false); |
1420 return 0; | 1421 return 0; |
1421 } | 1422 } |
1422 | 1423 |
| 1424 gfx::GLImage* |
| 1425 GLES2DecoderWithShaderTestBase::MockCommandBufferEngine::GetImage( |
| 1426 int32 image_id) { |
| 1427 return image_id == kImageId ? valid_image_.get() : NULL; |
| 1428 } |
| 1429 |
1423 void GLES2DecoderWithShaderTestBase::SetUp() { | 1430 void GLES2DecoderWithShaderTestBase::SetUp() { |
1424 GLES2DecoderTestBase::SetUp(); | 1431 GLES2DecoderTestBase::SetUp(); |
1425 SetupDefaultProgram(); | 1432 SetupDefaultProgram(); |
1426 } | 1433 } |
1427 | 1434 |
1428 // Include the auto-generated part of this file. We split this because it means | 1435 // Include the auto-generated part of this file. We split this because it means |
1429 // we can easily edit the non-auto generated parts right here in this file | 1436 // we can easily edit the non-auto generated parts right here in this file |
1430 // instead of having to edit some template or the code generator. | 1437 // instead of having to edit some template or the code generator. |
1431 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" | 1438 #include "gpu/command_buffer/service/gles2_cmd_decoder_unittest_0_autogen.h" |
1432 | 1439 |
1433 } // namespace gles2 | 1440 } // namespace gles2 |
1434 } // namespace gpu | 1441 } // namespace gpu |
OLD | NEW |