OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "cc/resources/resource_provider.h" | 5 #include "cc/resources/resource_provider.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 3150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3161 void InitializeGLAndCheck(ContextSharedData* shared_data, | 3161 void InitializeGLAndCheck(ContextSharedData* shared_data, |
3162 ResourceProvider* resource_provider, | 3162 ResourceProvider* resource_provider, |
3163 FakeOutputSurface* output_surface) { | 3163 FakeOutputSurface* output_surface) { |
3164 scoped_ptr<ResourceProviderContext> context_owned = | 3164 scoped_ptr<ResourceProviderContext> context_owned = |
3165 ResourceProviderContext::Create(shared_data); | 3165 ResourceProviderContext::Create(shared_data); |
3166 ResourceProviderContext* context = context_owned.get(); | 3166 ResourceProviderContext* context = context_owned.get(); |
3167 | 3167 |
3168 scoped_refptr<TestContextProvider> context_provider = | 3168 scoped_refptr<TestContextProvider> context_provider = |
3169 TestContextProvider::Create( | 3169 TestContextProvider::Create( |
3170 context_owned.PassAs<TestWebGraphicsContext3D>()); | 3170 context_owned.PassAs<TestWebGraphicsContext3D>()); |
3171 output_surface->InitializeAndSetContext3d(context_provider, NULL); | 3171 output_surface->InitializeAndSetContext3d(context_provider); |
3172 resource_provider->InitializeGL(); | 3172 resource_provider->InitializeGL(); |
3173 | 3173 |
3174 CheckCreateResource(ResourceProvider::GLTexture, resource_provider, context); | 3174 CheckCreateResource(ResourceProvider::GLTexture, resource_provider, context); |
3175 } | 3175 } |
3176 | 3176 |
3177 TEST(ResourceProviderTest, BasicInitializeGLSoftware) { | 3177 TEST(ResourceProviderTest, BasicInitializeGLSoftware) { |
3178 scoped_ptr<ContextSharedData> shared_data = ContextSharedData::Create(); | 3178 scoped_ptr<ContextSharedData> shared_data = ContextSharedData::Create(); |
3179 FakeOutputSurfaceClient client; | 3179 FakeOutputSurfaceClient client; |
3180 scoped_ptr<FakeOutputSurface> output_surface( | 3180 scoped_ptr<FakeOutputSurface> output_surface( |
3181 FakeOutputSurface::CreateDeferredGL( | 3181 FakeOutputSurface::CreateDeferredGL( |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3339 resource_provider->AllocateForTesting(id); | 3339 resource_provider->AllocateForTesting(id); |
3340 Mock::VerifyAndClearExpectations(context); | 3340 Mock::VerifyAndClearExpectations(context); |
3341 | 3341 |
3342 DCHECK_EQ(10u, context->PeekTextureId()); | 3342 DCHECK_EQ(10u, context->PeekTextureId()); |
3343 resource_provider->DeleteResource(id); | 3343 resource_provider->DeleteResource(id); |
3344 } | 3344 } |
3345 } | 3345 } |
3346 | 3346 |
3347 } // namespace | 3347 } // namespace |
3348 } // namespace cc | 3348 } // namespace cc |
OLD | NEW |