| 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 "gpu/command_buffer/service/gles2_cmd_decoder.h" | 5 #include "gpu/command_buffer/service/gles2_cmd_decoder.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" | 9 #include "gpu/command_buffer/common/gles2_cmd_format.h" |
| 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" | 10 #include "gpu/command_buffer/common/gles2_cmd_utils.h" |
| (...skipping 754 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 // second check is after BufferData, simulate fail here | 765 // second check is after BufferData, simulate fail here |
| 766 .WillOnce(Return(GL_INVALID_OPERATION)) | 766 .WillOnce(Return(GL_INVALID_OPERATION)) |
| 767 // third error check is fall-through call to sync ReadPixels | 767 // third error check is fall-through call to sync ReadPixels |
| 768 .WillOnce(Return(GL_NO_ERROR)) | 768 .WillOnce(Return(GL_NO_ERROR)) |
| 769 .RetiresOnSaturation(); | 769 .RetiresOnSaturation(); |
| 770 | 770 |
| 771 EXPECT_CALL(*gl_, | 771 EXPECT_CALL(*gl_, |
| 772 ReadPixels(0, 0, kWidth, kHeight, GL_RGB, GL_UNSIGNED_BYTE, _)) | 772 ReadPixels(0, 0, kWidth, kHeight, GL_RGB, GL_UNSIGNED_BYTE, _)) |
| 773 .Times(1); | 773 .Times(1); |
| 774 EXPECT_CALL(*gl_, GenBuffersARB(1, _)).Times(1); | 774 EXPECT_CALL(*gl_, GenBuffersARB(1, _)).Times(1); |
| 775 EXPECT_CALL(*gl_, DeleteBuffersARB(1, _)).Times(1); |
| 775 EXPECT_CALL(*gl_, BindBuffer(GL_PIXEL_PACK_BUFFER_ARB, _)).Times(2); | 776 EXPECT_CALL(*gl_, BindBuffer(GL_PIXEL_PACK_BUFFER_ARB, _)).Times(2); |
| 776 EXPECT_CALL(*gl_, | 777 EXPECT_CALL(*gl_, |
| 777 BufferData(GL_PIXEL_PACK_BUFFER_ARB, _, NULL, GL_STREAM_READ)) | 778 BufferData(GL_PIXEL_PACK_BUFFER_ARB, _, NULL, GL_STREAM_READ)) |
| 778 .Times(1); | 779 .Times(1); |
| 779 | 780 |
| 780 ReadPixels cmd; | 781 ReadPixels cmd; |
| 781 cmd.Init(0, | 782 cmd.Init(0, |
| 782 0, | 783 0, |
| 783 kWidth, | 784 kWidth, |
| 784 kHeight, | 785 kHeight, |
| (...skipping 1609 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2394 EXPECT_EQ(1, result->GetNumResults()); | 2395 EXPECT_EQ(1, result->GetNumResults()); |
| 2395 EXPECT_EQ(GL_NO_ERROR, GetGLError()); | 2396 EXPECT_EQ(GL_NO_ERROR, GetGLError()); |
| 2396 } | 2397 } |
| 2397 | 2398 |
| 2398 // TODO(gman): PixelStorei | 2399 // TODO(gman): PixelStorei |
| 2399 | 2400 |
| 2400 // TODO(gman): SwapBuffers | 2401 // TODO(gman): SwapBuffers |
| 2401 | 2402 |
| 2402 } // namespace gles2 | 2403 } // namespace gles2 |
| 2403 } // namespace gpu | 2404 } // namespace gpu |
| OLD | NEW |