| 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 "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "gpu/command_buffer/common/sync_token.h" | 6 #include "gpu/command_buffer/common/sync_token.h" |
| 7 #include "gpu/command_buffer/service/feature_info.h" | 7 #include "gpu/command_buffer/service/feature_info.h" |
| 8 #include "gpu/command_buffer/service/gpu_service_test.h" | 8 #include "gpu/command_buffer/service/gpu_service_test.h" |
| 9 #include "gpu/command_buffer/service/mailbox_manager_impl.h" | 9 #include "gpu/command_buffer/service/mailbox_manager_impl.h" |
| 10 #include "gpu/command_buffer/service/mailbox_manager_sync.h" | 10 #include "gpu/command_buffer/service/mailbox_manager_sync.h" |
| (...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 | 191 |
| 192 class MailboxManagerSyncTest : public MailboxManagerTest { | 192 class MailboxManagerSyncTest : public MailboxManagerTest { |
| 193 public: | 193 public: |
| 194 MailboxManagerSyncTest() {} | 194 MailboxManagerSyncTest() {} |
| 195 ~MailboxManagerSyncTest() override {} | 195 ~MailboxManagerSyncTest() override {} |
| 196 | 196 |
| 197 protected: | 197 protected: |
| 198 void SetUp() override { | 198 void SetUp() override { |
| 199 MailboxManagerTest::SetUpWithSynchronizer(); | 199 MailboxManagerTest::SetUpWithSynchronizer(); |
| 200 manager2_ = new MailboxManagerSync(); | 200 manager2_ = new MailboxManagerSync(); |
| 201 context_ = new gfx::GLContextStub(); | 201 context_ = new gl::GLContextStub(); |
| 202 surface_ = new gfx::GLSurfaceStub(); | 202 surface_ = new gl::GLSurfaceStub(); |
| 203 context_->MakeCurrent(surface_.get()); | 203 context_->MakeCurrent(surface_.get()); |
| 204 } | 204 } |
| 205 | 205 |
| 206 Texture* DefineTexture() { | 206 Texture* DefineTexture() { |
| 207 Texture* texture = CreateTexture(); | 207 Texture* texture = CreateTexture(); |
| 208 const GLsizei levels_needed = TextureManager::ComputeMipMapCount( | 208 const GLsizei levels_needed = TextureManager::ComputeMipMapCount( |
| 209 GL_TEXTURE_2D, kMaxTextureWidth, kMaxTextureHeight, kMaxTextureDepth); | 209 GL_TEXTURE_2D, kMaxTextureWidth, kMaxTextureHeight, kMaxTextureDepth); |
| 210 SetTarget(texture, GL_TEXTURE_2D, levels_needed); | 210 SetTarget(texture, GL_TEXTURE_2D, levels_needed); |
| 211 SetLevelInfo(texture, GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA, | 211 SetLevelInfo(texture, GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 1, 0, GL_RGBA, |
| 212 GL_UNSIGNED_BYTE, gfx::Rect(1, 1)); | 212 GL_UNSIGNED_BYTE, gfx::Rect(1, 1)); |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 .Times(1) | 246 .Times(1) |
| 247 .RetiresOnSaturation(); | 247 .RetiresOnSaturation(); |
| 248 } | 248 } |
| 249 | 249 |
| 250 void TearDown() override { | 250 void TearDown() override { |
| 251 context_->ReleaseCurrent(NULL); | 251 context_->ReleaseCurrent(NULL); |
| 252 MailboxManagerTest::TearDown(); | 252 MailboxManagerTest::TearDown(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 scoped_refptr<MailboxManager> manager2_; | 255 scoped_refptr<MailboxManager> manager2_; |
| 256 scoped_refptr<gfx::GLContext> context_; | 256 scoped_refptr<gl::GLContext> context_; |
| 257 scoped_refptr<gfx::GLSurface> surface_; | 257 scoped_refptr<gl::GLSurface> surface_; |
| 258 | 258 |
| 259 private: | 259 private: |
| 260 DISALLOW_COPY_AND_ASSIGN(MailboxManagerSyncTest); | 260 DISALLOW_COPY_AND_ASSIGN(MailboxManagerSyncTest); |
| 261 }; | 261 }; |
| 262 | 262 |
| 263 TEST_F(MailboxManagerSyncTest, ProduceDestroy) { | 263 TEST_F(MailboxManagerSyncTest, ProduceDestroy) { |
| 264 Texture* texture = DefineTexture(); | 264 Texture* texture = DefineTexture(); |
| 265 Mailbox name = Mailbox::Generate(); | 265 Mailbox name = Mailbox::Generate(); |
| 266 | 266 |
| 267 InSequence sequence; | 267 InSequence sequence; |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 DestroyTexture(texture2); | 688 DestroyTexture(texture2); |
| 689 DestroyTexture(new_texture); | 689 DestroyTexture(new_texture); |
| 690 } | 690 } |
| 691 | 691 |
| 692 // TODO: Texture::level_infos_[][].size() | 692 // TODO: Texture::level_infos_[][].size() |
| 693 | 693 |
| 694 // TODO: unsupported targets and formats | 694 // TODO: unsupported targets and formats |
| 695 | 695 |
| 696 } // namespace gles2 | 696 } // namespace gles2 |
| 697 } // namespace gpu | 697 } // namespace gpu |
| OLD | NEW |