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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 MOCK_METHOD3(texParameteri, void(GLenum target, GLenum pname, GLint param)); | 96 MOCK_METHOD3(texParameteri, void(GLenum target, GLenum pname, GLint param)); |
97 MOCK_METHOD1(waitSyncPoint, void(GLuint sync_point)); | 97 MOCK_METHOD1(waitSyncPoint, void(GLuint sync_point)); |
98 MOCK_METHOD0(insertSyncPoint, GLuint(void)); | 98 MOCK_METHOD0(insertSyncPoint, GLuint(void)); |
99 MOCK_METHOD2(produceTextureCHROMIUM, | 99 MOCK_METHOD2(produceTextureCHROMIUM, |
100 void(GLenum target, const GLbyte* mailbox)); | 100 void(GLenum target, const GLbyte* mailbox)); |
101 MOCK_METHOD2(consumeTextureCHROMIUM, | 101 MOCK_METHOD2(consumeTextureCHROMIUM, |
102 void(GLenum target, const GLbyte* mailbox)); | 102 void(GLenum target, const GLbyte* mailbox)); |
103 | 103 |
104 // Force all textures to be consecutive numbers starting at "1", | 104 // Force all textures to be consecutive numbers starting at "1", |
105 // so we easily can test for them. | 105 // so we easily can test for them. |
106 virtual GLuint NextTextureId() override { | 106 GLuint NextTextureId() override { |
107 base::AutoLock lock(namespace_->lock); | 107 base::AutoLock lock(namespace_->lock); |
108 return namespace_->next_texture_id++; | 108 return namespace_->next_texture_id++; |
109 } | 109 } |
110 virtual void RetireTextureId(GLuint) override {} | 110 void RetireTextureId(GLuint) override {} |
111 }; | 111 }; |
112 | 112 |
113 // Shared data between multiple ResourceProviderContext. This contains mailbox | 113 // Shared data between multiple ResourceProviderContext. This contains mailbox |
114 // contents as well as information about sync points. | 114 // contents as well as information about sync points. |
115 class ContextSharedData { | 115 class ContextSharedData { |
116 public: | 116 public: |
117 static scoped_ptr<ContextSharedData> Create() { | 117 static scoped_ptr<ContextSharedData> Create() { |
118 return make_scoped_ptr(new ContextSharedData()); | 118 return make_scoped_ptr(new ContextSharedData()); |
119 } | 119 } |
120 | 120 |
(...skipping 3518 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3639 resource_provider->AllocateForTesting(id); | 3639 resource_provider->AllocateForTesting(id); |
3640 Mock::VerifyAndClearExpectations(context); | 3640 Mock::VerifyAndClearExpectations(context); |
3641 | 3641 |
3642 DCHECK_EQ(10u, context->PeekTextureId()); | 3642 DCHECK_EQ(10u, context->PeekTextureId()); |
3643 resource_provider->DeleteResource(id); | 3643 resource_provider->DeleteResource(id); |
3644 } | 3644 } |
3645 } | 3645 } |
3646 | 3646 |
3647 } // namespace | 3647 } // namespace |
3648 } // namespace cc | 3648 } // namespace cc |
OLD | NEW |