| 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 #include <vector> | 10 #include <vector> |
| (...skipping 2573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2584 scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create( | 2584 scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create( |
| 2585 output_surface.get(), shared_bitmap_manager_.get(), | 2585 output_surface.get(), shared_bitmap_manager_.get(), |
| 2586 gpu_memory_buffer_manager_.get(), NULL, 0, 1, | 2586 gpu_memory_buffer_manager_.get(), NULL, 0, 1, |
| 2587 use_image_texture_targets_)); | 2587 use_image_texture_targets_)); |
| 2588 | 2588 |
| 2589 gfx::Size size(1, 1); | 2589 gfx::Size size(1, 1); |
| 2590 ResourceFormat format = RGBA_8888; | 2590 ResourceFormat format = RGBA_8888; |
| 2591 int texture_id = 1; | 2591 int texture_id = 1; |
| 2592 | 2592 |
| 2593 // Check that the texture gets created with the right sampler settings. | 2593 // Check that the texture gets created with the right sampler settings. |
| 2594 ResourceId id = resource_provider->CreateResourceWithTextureTarget( | 2594 ResourceId id = resource_provider->CreateResource( |
| 2595 size, GL_TEXTURE_2D, ResourceProvider::TEXTURE_HINT_IMMUTABLE, format); | 2595 size, ResourceProvider::TEXTURE_HINT_IMMUTABLE, format); |
| 2596 EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id)); | 2596 EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, texture_id)); |
| 2597 EXPECT_CALL(*context, | 2597 EXPECT_CALL(*context, |
| 2598 texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); | 2598 texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); |
| 2599 EXPECT_CALL(*context, | 2599 EXPECT_CALL(*context, |
| 2600 texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); | 2600 texParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); |
| 2601 EXPECT_CALL( | 2601 EXPECT_CALL( |
| 2602 *context, | 2602 *context, |
| 2603 texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); | 2603 texParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); |
| 2604 EXPECT_CALL( | 2604 EXPECT_CALL( |
| 2605 *context, | 2605 *context, |
| (...skipping 923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3529 resource_provider->AllocateForTesting(id); | 3529 resource_provider->AllocateForTesting(id); |
| 3530 Mock::VerifyAndClearExpectations(context); | 3530 Mock::VerifyAndClearExpectations(context); |
| 3531 | 3531 |
| 3532 DCHECK_EQ(10u, context->PeekTextureId()); | 3532 DCHECK_EQ(10u, context->PeekTextureId()); |
| 3533 resource_provider->DeleteResource(id); | 3533 resource_provider->DeleteResource(id); |
| 3534 } | 3534 } |
| 3535 } | 3535 } |
| 3536 | 3536 |
| 3537 } // namespace | 3537 } // namespace |
| 3538 } // namespace cc | 3538 } // namespace cc |
| OLD | NEW |