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 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 return scoped_refptr<TestTexture>(); | 151 return scoped_refptr<TestTexture>(); |
152 } | 152 } |
153 return textures_[mailbox]; | 153 return textures_[mailbox]; |
154 } | 154 } |
155 | 155 |
156 private: | 156 private: |
157 ContextSharedData() : next_sync_point_(1), next_mailbox_(1) {} | 157 ContextSharedData() : next_sync_point_(1), next_mailbox_(1) {} |
158 | 158 |
159 uint32 next_sync_point_; | 159 uint32 next_sync_point_; |
160 unsigned next_mailbox_; | 160 unsigned next_mailbox_; |
161 typedef base::hash_map<unsigned, scoped_refptr<TestTexture> > TextureMap; | 161 typedef base::hash_map<unsigned, scoped_refptr<TestTexture>> TextureMap; |
162 TextureMap textures_; | 162 TextureMap textures_; |
163 base::hash_map<unsigned, uint32> sync_point_for_mailbox_; | 163 base::hash_map<unsigned, uint32> sync_point_for_mailbox_; |
164 }; | 164 }; |
165 | 165 |
166 class ResourceProviderContext : public TestWebGraphicsContext3D { | 166 class ResourceProviderContext : public TestWebGraphicsContext3D { |
167 public: | 167 public: |
168 static scoped_ptr<ResourceProviderContext> Create( | 168 static scoped_ptr<ResourceProviderContext> Create( |
169 ContextSharedData* shared_data) { | 169 ContextSharedData* shared_data) { |
170 return make_scoped_ptr(new ResourceProviderContext(shared_data)); | 170 return make_scoped_ptr(new ResourceProviderContext(shared_data)); |
171 } | 171 } |
(...skipping 3496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3668 resource_provider->AllocateForTesting(id); | 3668 resource_provider->AllocateForTesting(id); |
3669 Mock::VerifyAndClearExpectations(context); | 3669 Mock::VerifyAndClearExpectations(context); |
3670 | 3670 |
3671 DCHECK_EQ(10u, context->PeekTextureId()); | 3671 DCHECK_EQ(10u, context->PeekTextureId()); |
3672 resource_provider->DeleteResource(id); | 3672 resource_provider->DeleteResource(id); |
3673 } | 3673 } |
3674 } | 3674 } |
3675 | 3675 |
3676 } // namespace | 3676 } // namespace |
3677 } // namespace cc | 3677 } // namespace cc |
OLD | NEW |