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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 1830 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1841 | 1841 |
1842 EXPECT_CALL(*gl_, DeleteTextures(1, _)) | 1842 EXPECT_CALL(*gl_, DeleteTextures(1, _)) |
1843 .Times(1) | 1843 .Times(1) |
1844 .RetiresOnSaturation(); | 1844 .RetiresOnSaturation(); |
1845 texture_manager1_->RemoveTexture(10); | 1845 texture_manager1_->RemoveTexture(10); |
1846 texture_manager2_->RemoveTexture(20); | 1846 texture_manager2_->RemoveTexture(20); |
1847 } | 1847 } |
1848 | 1848 |
1849 TEST_F(SharedTextureTest, FBOCompletenessCheck) { | 1849 TEST_F(SharedTextureTest, FBOCompletenessCheck) { |
1850 const GLenum kCompleteValue = GL_FRAMEBUFFER_COMPLETE; | 1850 const GLenum kCompleteValue = GL_FRAMEBUFFER_COMPLETE; |
1851 FramebufferManager framebuffer_manager1(1, 1); | 1851 FramebufferManager framebuffer_manager1( |
| 1852 1, 1, ContextGroup::CONTEXT_TYPE_UNDEFINED); |
1852 texture_manager1_->set_framebuffer_manager(&framebuffer_manager1); | 1853 texture_manager1_->set_framebuffer_manager(&framebuffer_manager1); |
1853 FramebufferManager framebuffer_manager2(1, 1); | 1854 FramebufferManager framebuffer_manager2( |
| 1855 1, 1, ContextGroup::CONTEXT_TYPE_UNDEFINED); |
1854 texture_manager2_->set_framebuffer_manager(&framebuffer_manager2); | 1856 texture_manager2_->set_framebuffer_manager(&framebuffer_manager2); |
1855 | 1857 |
1856 scoped_refptr<TextureRef> ref1 = texture_manager1_->CreateTexture(10, 10); | 1858 scoped_refptr<TextureRef> ref1 = texture_manager1_->CreateTexture(10, 10); |
1857 framebuffer_manager1.CreateFramebuffer(10, 10); | 1859 framebuffer_manager1.CreateFramebuffer(10, 10); |
1858 scoped_refptr<Framebuffer> framebuffer1 = | 1860 scoped_refptr<Framebuffer> framebuffer1 = |
1859 framebuffer_manager1.GetFramebuffer(10); | 1861 framebuffer_manager1.GetFramebuffer(10); |
1860 framebuffer1->AttachTexture( | 1862 framebuffer1->AttachTexture( |
1861 GL_COLOR_ATTACHMENT0, ref1.get(), GL_TEXTURE_2D, 0, 0); | 1863 GL_COLOR_ATTACHMENT0, ref1.get(), GL_TEXTURE_2D, 0, 0); |
1862 EXPECT_FALSE(framebuffer_manager1.IsComplete(framebuffer1.get())); | 1864 EXPECT_FALSE(framebuffer_manager1.IsComplete(framebuffer1.get())); |
1863 EXPECT_NE(kCompleteValue, framebuffer1->IsPossiblyComplete()); | 1865 EXPECT_NE(kCompleteValue, framebuffer1->IsPossiblyComplete()); |
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2242 ExpectValid(GL_DEPTH_COMPONENT, GL_FLOAT, GL_DEPTH_COMPONENT32F); | 2244 ExpectValid(GL_DEPTH_COMPONENT, GL_FLOAT, GL_DEPTH_COMPONENT32F); |
2243 ExpectValid(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_DEPTH24_STENCIL8); | 2245 ExpectValid(GL_DEPTH_STENCIL, GL_UNSIGNED_INT_24_8, GL_DEPTH24_STENCIL8); |
2244 ExpectValid(GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, | 2246 ExpectValid(GL_DEPTH_STENCIL, GL_FLOAT_32_UNSIGNED_INT_24_8_REV, |
2245 GL_DEPTH32F_STENCIL8); | 2247 GL_DEPTH32F_STENCIL8); |
2246 | 2248 |
2247 ExpectInvalid(GL_RGB_INTEGER, GL_INT, GL_RGBA8); | 2249 ExpectInvalid(GL_RGB_INTEGER, GL_INT, GL_RGBA8); |
2248 } | 2250 } |
2249 | 2251 |
2250 } // namespace gles2 | 2252 } // namespace gles2 |
2251 } // namespace gpu | 2253 } // namespace gpu |
OLD | NEW |