OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "mojo/gpu/texture_uploader.h" | 5 #include "mojo/gpu/texture_uploader.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
9 #include "mojo/gpu/texture_cache.h" | 9 #include "mojo/gpu/texture_cache.h" |
10 #include "mojo/public/cpp/application/application_impl.h" | 10 #include "mojo/public/cpp/application/application_impl.h" |
11 #include "mojo/public/cpp/application/application_test_base.h" | 11 #include "mojo/public/cpp/application/application_test_base.h" |
12 #include "mojo/public/cpp/application/connect.h" | 12 #include "mojo/public/cpp/application/connect.h" |
13 #include "mojo/services/surfaces/public/interfaces/surface_id.mojom.h" | 13 #include "mojo/services/surfaces/interfaces/surface_id.mojom.h" |
14 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 class TextureUploaderTest : public mojo::test::ApplicationTestBase { | 18 class TextureUploaderTest : public mojo::test::ApplicationTestBase { |
19 public: | 19 public: |
20 TextureUploaderTest() : surface_id_(1u), weak_factory_(this) {} | 20 TextureUploaderTest() : surface_id_(1u), weak_factory_(this) {} |
21 ~TextureUploaderTest() override {} | 21 ~TextureUploaderTest() override {} |
22 | 22 |
23 void SetUp() override { | 23 void SetUp() override { |
(...skipping 27 matching lines...) Expand all Loading... |
51 size.width = 100; | 51 size.width = 100; |
52 size.height = 100; | 52 size.height = 100; |
53 scoped_ptr<mojo::TextureCache::TextureInfo> texture_info( | 53 scoped_ptr<mojo::TextureCache::TextureInfo> texture_info( |
54 texture_cache_->GetTexture(size).Pass()); | 54 texture_cache_->GetTexture(size).Pass()); |
55 mojo::FramePtr frame = mojo::TextureUploader::GetUploadFrame( | 55 mojo::FramePtr frame = mojo::TextureUploader::GetUploadFrame( |
56 gl_context_, texture_info->ResourceId(), texture_info->Texture()); | 56 gl_context_, texture_info->ResourceId(), texture_info->Texture()); |
57 EXPECT_FALSE(frame.is_null()); | 57 EXPECT_FALSE(frame.is_null()); |
58 } | 58 } |
59 | 59 |
60 } // namespace | 60 } // namespace |
OLD | NEW |