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 3167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3178 TestContextProvider::Create( | 3178 TestContextProvider::Create( |
3179 context_owned.PassAs<TestWebGraphicsContext3D>()); | 3179 context_owned.PassAs<TestWebGraphicsContext3D>()); |
3180 output_surface->InitializeAndSetContext3d(context_provider); | 3180 output_surface->InitializeAndSetContext3d(context_provider); |
3181 resource_provider->InitializeGL(); | 3181 resource_provider->InitializeGL(); |
3182 | 3182 |
3183 CheckCreateResource(ResourceProvider::GLTexture, resource_provider, context); | 3183 CheckCreateResource(ResourceProvider::GLTexture, resource_provider, context); |
3184 } | 3184 } |
3185 | 3185 |
3186 TEST(ResourceProviderTest, BasicInitializeGLSoftware) { | 3186 TEST(ResourceProviderTest, BasicInitializeGLSoftware) { |
3187 scoped_ptr<ContextSharedData> shared_data = ContextSharedData::Create(); | 3187 scoped_ptr<ContextSharedData> shared_data = ContextSharedData::Create(); |
3188 FakeOutputSurfaceClient client; | 3188 bool delegated_rendering = false; |
3189 scoped_ptr<FakeOutputSurface> output_surface( | 3189 scoped_ptr<FakeOutputSurface> output_surface( |
3190 FakeOutputSurface::CreateDeferredGL( | 3190 FakeOutputSurface::CreateDeferredGL( |
3191 scoped_ptr<SoftwareOutputDevice>(new SoftwareOutputDevice))); | 3191 scoped_ptr<SoftwareOutputDevice>(new SoftwareOutputDevice), |
| 3192 delegated_rendering)); |
| 3193 FakeOutputSurfaceClient client(output_surface.get()); |
3192 EXPECT_TRUE(output_surface->BindToClient(&client)); | 3194 EXPECT_TRUE(output_surface->BindToClient(&client)); |
3193 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( | 3195 scoped_ptr<SharedBitmapManager> shared_bitmap_manager( |
3194 new TestSharedBitmapManager()); | 3196 new TestSharedBitmapManager()); |
3195 scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create( | 3197 scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create( |
3196 output_surface.get(), shared_bitmap_manager.get(), 0, false, 1, false)); | 3198 output_surface.get(), shared_bitmap_manager.get(), 0, false, 1, false)); |
3197 | 3199 |
3198 CheckCreateResource(ResourceProvider::Bitmap, resource_provider.get(), NULL); | 3200 CheckCreateResource(ResourceProvider::Bitmap, resource_provider.get(), NULL); |
3199 | 3201 |
3200 InitializeGLAndCheck(shared_data.get(), | 3202 InitializeGLAndCheck(shared_data.get(), |
3201 resource_provider.get(), | 3203 resource_provider.get(), |
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3352 resource_provider->AllocateForTesting(id); | 3354 resource_provider->AllocateForTesting(id); |
3353 Mock::VerifyAndClearExpectations(context); | 3355 Mock::VerifyAndClearExpectations(context); |
3354 | 3356 |
3355 DCHECK_EQ(10u, context->PeekTextureId()); | 3357 DCHECK_EQ(10u, context->PeekTextureId()); |
3356 resource_provider->DeleteResource(id); | 3358 resource_provider->DeleteResource(id); |
3357 } | 3359 } |
3358 } | 3360 } |
3359 | 3361 |
3360 } // namespace | 3362 } // namespace |
3361 } // namespace cc | 3363 } // namespace cc |
OLD | NEW |