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/texture_manager.h" | 5 #include "gpu/command_buffer/service/texture_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 2346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2357 | 2357 |
2358 EXPECT_CALL(*gl_, DeleteTextures(1, _)) | 2358 EXPECT_CALL(*gl_, DeleteTextures(1, _)) |
2359 .Times(1) | 2359 .Times(1) |
2360 .RetiresOnSaturation(); | 2360 .RetiresOnSaturation(); |
2361 texture_manager1_->RemoveTexture(10); | 2361 texture_manager1_->RemoveTexture(10); |
2362 texture_manager2_->RemoveTexture(20); | 2362 texture_manager2_->RemoveTexture(20); |
2363 } | 2363 } |
2364 | 2364 |
2365 TEST_F(SharedTextureTest, FBOCompletenessCheck) { | 2365 TEST_F(SharedTextureTest, FBOCompletenessCheck) { |
2366 const GLenum kCompleteValue = GL_FRAMEBUFFER_COMPLETE; | 2366 const GLenum kCompleteValue = GL_FRAMEBUFFER_COMPLETE; |
2367 FramebufferManager framebuffer_manager1(1, 1, CONTEXT_TYPE_OPENGLES2, | 2367 FramebufferManager framebuffer_manager1(1, 1, nullptr); |
2368 nullptr); | |
2369 texture_manager1_->set_framebuffer_manager(&framebuffer_manager1); | 2368 texture_manager1_->set_framebuffer_manager(&framebuffer_manager1); |
2370 FramebufferManager framebuffer_manager2(1, 1, CONTEXT_TYPE_OPENGLES2, | 2369 FramebufferManager framebuffer_manager2(1, 1, nullptr); |
2371 nullptr); | |
2372 texture_manager2_->set_framebuffer_manager(&framebuffer_manager2); | 2370 texture_manager2_->set_framebuffer_manager(&framebuffer_manager2); |
2373 | 2371 |
2374 scoped_refptr<TextureRef> ref1 = texture_manager1_->CreateTexture(10, 10); | 2372 scoped_refptr<TextureRef> ref1 = texture_manager1_->CreateTexture(10, 10); |
2375 framebuffer_manager1.CreateFramebuffer(10, 10); | 2373 framebuffer_manager1.CreateFramebuffer(10, 10); |
2376 scoped_refptr<Framebuffer> framebuffer1 = | 2374 scoped_refptr<Framebuffer> framebuffer1 = |
2377 framebuffer_manager1.GetFramebuffer(10); | 2375 framebuffer_manager1.GetFramebuffer(10); |
2378 framebuffer1->AttachTexture( | 2376 framebuffer1->AttachTexture( |
2379 GL_COLOR_ATTACHMENT0, ref1.get(), GL_TEXTURE_2D, 0, 0); | 2377 GL_COLOR_ATTACHMENT0, ref1.get(), GL_TEXTURE_2D, 0, 0); |
2380 EXPECT_FALSE(framebuffer_manager1.IsComplete(framebuffer1.get())); | 2378 EXPECT_FALSE(framebuffer_manager1.IsComplete(framebuffer1.get())); |
2381 EXPECT_NE(kCompleteValue, | 2379 EXPECT_NE(kCompleteValue, |
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2770 ExpectValid( | 2768 ExpectValid( |
2771 true, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_DEPTH24_STENCIL8); | 2769 true, GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_DEPTH24_STENCIL8); |
2772 ExpectValid(true, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, | 2770 ExpectValid(true, GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, |
2773 GL_DEPTH32F_STENCIL8); | 2771 GL_DEPTH32F_STENCIL8); |
2774 | 2772 |
2775 ExpectInvalid(true, GL_RGB_INTEGER, GL_INT, GL_RGBA8); | 2773 ExpectInvalid(true, GL_RGB_INTEGER, GL_INT, GL_RGBA8); |
2776 } | 2774 } |
2777 | 2775 |
2778 } // namespace gles2 | 2776 } // namespace gles2 |
2779 } // namespace gpu | 2777 } // namespace gpu |
OLD | NEW |