Index: cc/resources/resource_provider_unittest.cc |
diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc |
index a34aee6304bf8cb5d74493085a769500c5fcf893..50fbacee24fd2a750e9ee374addf17d3cd23394e 100644 |
--- a/cc/resources/resource_provider_unittest.cc |
+++ b/cc/resources/resource_provider_unittest.cc |
@@ -44,15 +44,15 @@ using blink::WebGLId; |
namespace cc { |
namespace { |
-static void EmptyReleaseCallback(unsigned sync_point, bool lost_resource) {} |
+static void EmptyReleaseCallback(uint32 sync_point, bool lost_resource) {} |
static void SharedMemoryReleaseCallback(scoped_ptr<base::SharedMemory> memory, |
- unsigned sync_point, |
+ uint32 sync_point, |
bool lost_resource) {} |
-static void ReleaseTextureMailbox(unsigned* release_sync_point, |
+static void ReleaseTextureMailbox(uint32* release_sync_point, |
bool* release_lost_resource, |
- unsigned sync_point, |
+ uint32 sync_point, |
bool lost_resource) { |
*release_sync_point = sync_point; |
*release_lost_resource = lost_resource; |
@@ -61,9 +61,9 @@ static void ReleaseTextureMailbox(unsigned* release_sync_point, |
static void ReleaseSharedMemoryCallback( |
scoped_ptr<base::SharedMemory> shared_memory, |
bool* release_called, |
- unsigned* release_sync_point, |
+ uint32* release_sync_point, |
bool* lost_resource_result, |
- unsigned sync_point, |
+ uint32 sync_point, |
bool lost_resource) { |
*release_called = true; |
*release_sync_point = sync_point; |
@@ -86,8 +86,8 @@ class TextureStateTrackingContext : public TestWebGraphicsContext3D { |
MOCK_METHOD2(bindTexture, void(WGC3Denum target, WebGLId texture)); |
MOCK_METHOD3(texParameteri, |
void(WGC3Denum target, WGC3Denum pname, WGC3Dint param)); |
- MOCK_METHOD1(waitSyncPoint, void(unsigned sync_point)); |
- MOCK_METHOD0(insertSyncPoint, unsigned(void)); |
+ MOCK_METHOD1(waitSyncPoint, void(uint32 sync_point)); |
+ MOCK_METHOD0(insertSyncPoint, uint32(void)); |
MOCK_METHOD2(produceTextureCHROMIUM, void(WGC3Denum target, |
const WGC3Dbyte* mailbox)); |
MOCK_METHOD2(consumeTextureCHROMIUM, void(WGC3Denum target, |
@@ -111,7 +111,7 @@ class ContextSharedData { |
return make_scoped_ptr(new ContextSharedData()); |
} |
- unsigned InsertSyncPoint() { return next_sync_point_++; } |
+ uint32 InsertSyncPoint() { return next_sync_point_++; } |
void GenMailbox(WGC3Dbyte* mailbox) { |
memset(mailbox, 0, sizeof(WGC3Dbyte[64])); |
@@ -120,7 +120,7 @@ class ContextSharedData { |
} |
void ProduceTexture(const WGC3Dbyte* mailbox_name, |
- unsigned sync_point, |
+ uint32 sync_point, |
scoped_refptr<TestTexture> texture) { |
unsigned mailbox = 0; |
memcpy(&mailbox, mailbox_name, sizeof(mailbox)); |
@@ -131,7 +131,7 @@ class ContextSharedData { |
} |
scoped_refptr<TestTexture> ConsumeTexture(const WGC3Dbyte* mailbox_name, |
- unsigned sync_point) { |
+ uint32 sync_point) { |
unsigned mailbox = 0; |
memcpy(&mailbox, mailbox_name, sizeof(mailbox)); |
DCHECK(mailbox && mailbox < next_mailbox_); |
@@ -149,11 +149,11 @@ class ContextSharedData { |
private: |
ContextSharedData() : next_sync_point_(1), next_mailbox_(1) {} |
- unsigned next_sync_point_; |
+ uint32 next_sync_point_; |
unsigned next_mailbox_; |
typedef base::hash_map<unsigned, scoped_refptr<TestTexture> > TextureMap; |
TextureMap textures_; |
- base::hash_map<unsigned, unsigned> sync_point_for_mailbox_; |
+ base::hash_map<unsigned, uint32> sync_point_for_mailbox_; |
}; |
class ResourceProviderContext : public TestWebGraphicsContext3D { |
@@ -163,8 +163,8 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { |
return make_scoped_ptr(new ResourceProviderContext(shared_data)); |
} |
- virtual unsigned insertSyncPoint() OVERRIDE { |
- unsigned sync_point = shared_data_->InsertSyncPoint(); |
+ virtual uint32 insertSyncPoint() OVERRIDE { |
+ uint32 sync_point = shared_data_->InsertSyncPoint(); |
// Commit the produceTextureCHROMIUM calls at this point, so that |
// they're associated with the sync point. |
for (PendingProduceTextureList::iterator it = |
@@ -178,7 +178,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { |
return sync_point; |
} |
- virtual void waitSyncPoint(unsigned sync_point) OVERRIDE { |
+ virtual void waitSyncPoint(uint32 sync_point) OVERRIDE { |
last_waited_sync_point_ = std::max(sync_point, last_waited_sync_point_); |
} |
@@ -332,7 +332,7 @@ class ResourceProviderContext : public TestWebGraphicsContext3D { |
}; |
typedef ScopedPtrDeque<PendingProduceTexture> PendingProduceTextureList; |
ContextSharedData* shared_data_; |
- unsigned last_waited_sync_point_; |
+ uint32 last_waited_sync_point_; |
PendingProduceTextureList pending_produce_textures_; |
}; |
@@ -482,10 +482,10 @@ class ResourceProviderTest |
ResourceProviderContext* context() { return context3d_; } |
- ResourceProvider::ResourceId CreateChildMailbox(unsigned* release_sync_point, |
+ ResourceProvider::ResourceId CreateChildMailbox(uint32* release_sync_point, |
bool* lost_resource, |
bool* release_called, |
- unsigned* sync_point) { |
+ uint32* sync_point) { |
if (GetParam() == ResourceProvider::GLTexture) { |
unsigned texture = child_context_->createTexture(); |
gpu::Mailbox gpu_mailbox; |
@@ -503,7 +503,8 @@ class ResourceProviderTest |
release_sync_point, |
lost_resource)); |
return child_resource_provider_->CreateResourceFromTextureMailbox( |
- TextureMailbox(gpu_mailbox, *sync_point), callback.Pass()); |
+ TextureMailbox(gpu_mailbox, GL_TEXTURE_2D, *sync_point), |
+ callback.Pass()); |
} else { |
gfx::Size size(64, 64); |
scoped_ptr<base::SharedMemory> shared_memory( |
@@ -663,7 +664,7 @@ TEST_P(ResourceProviderTest, TransferGLResources) { |
child_context_->genMailboxCHROMIUM(external_mailbox.name); |
child_context_->produceTextureCHROMIUM(GL_TEXTURE_EXTERNAL_OES, |
external_mailbox.name); |
- const unsigned external_sync_point = child_context_->insertSyncPoint(); |
+ const uint32 external_sync_point = child_context_->insertSyncPoint(); |
ResourceProvider::ResourceId id3 = |
child_resource_provider_->CreateResourceFromTextureMailbox( |
TextureMailbox( |
@@ -1597,18 +1598,18 @@ TEST_P(ResourceProviderTest, TransferMailboxResources) { |
gpu::Mailbox mailbox; |
context()->genMailboxCHROMIUM(mailbox.name); |
context()->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
- unsigned sync_point = context()->insertSyncPoint(); |
+ uint32 sync_point = context()->insertSyncPoint(); |
// All the logic below assumes that the sync points are all positive. |
EXPECT_LT(0u, sync_point); |
- unsigned release_sync_point = 0; |
+ uint32 release_sync_point = 0; |
bool lost_resource = false; |
ReleaseCallback callback = |
base::Bind(ReleaseTextureMailbox, &release_sync_point, &lost_resource); |
ResourceProvider::ResourceId resource = |
resource_provider_->CreateResourceFromTextureMailbox( |
- TextureMailbox(mailbox, sync_point), |
+ TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point), |
SingleReleaseCallback::Create(callback)); |
EXPECT_EQ(1u, context()->NumTextures()); |
EXPECT_EQ(0u, release_sync_point); |
@@ -1656,7 +1657,7 @@ TEST_P(ResourceProviderTest, TransferMailboxResources) { |
EXPECT_LT(0u, sync_point); |
release_sync_point = 0; |
resource = resource_provider_->CreateResourceFromTextureMailbox( |
- TextureMailbox(mailbox, sync_point), |
+ TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point), |
SingleReleaseCallback::Create(callback)); |
EXPECT_EQ(1u, context()->NumTextures()); |
EXPECT_EQ(0u, release_sync_point); |
@@ -1835,10 +1836,10 @@ TEST_P(ResourceProviderTest, LostResourceInGrandParent) { |
} |
TEST_P(ResourceProviderTest, LostMailboxInParent) { |
- unsigned release_sync_point = 0; |
+ uint32 release_sync_point = 0; |
bool lost_resource = false; |
bool release_called = false; |
- unsigned sync_point = 0; |
+ uint32 sync_point = 0; |
ResourceProvider::ResourceId resource = CreateChildMailbox( |
&release_sync_point, &lost_resource, &release_called, &sync_point); |
@@ -1885,10 +1886,10 @@ TEST_P(ResourceProviderTest, LostMailboxInParent) { |
} |
TEST_P(ResourceProviderTest, LostMailboxInGrandParent) { |
- unsigned release_sync_point = 0; |
+ uint32 release_sync_point = 0; |
bool lost_resource = false; |
bool release_called = false; |
- unsigned sync_point = 0; |
+ uint32 sync_point = 0; |
ResourceProvider::ResourceId resource = CreateChildMailbox( |
&release_sync_point, &lost_resource, &release_called, &sync_point); |
@@ -1953,10 +1954,10 @@ TEST_P(ResourceProviderTest, LostMailboxInGrandParent) { |
} |
TEST_P(ResourceProviderTest, Shutdown) { |
- unsigned release_sync_point = 0; |
+ uint32 release_sync_point = 0; |
bool lost_resource = false; |
bool release_called = false; |
- unsigned sync_point = 0; |
+ uint32 sync_point = 0; |
CreateChildMailbox( |
&release_sync_point, &lost_resource, &release_called, &sync_point); |
@@ -1973,10 +1974,10 @@ TEST_P(ResourceProviderTest, Shutdown) { |
} |
TEST_P(ResourceProviderTest, ShutdownWithExportedResource) { |
- unsigned release_sync_point = 0; |
+ uint32 release_sync_point = 0; |
bool lost_resource = false; |
bool release_called = false; |
- unsigned sync_point = 0; |
+ uint32 sync_point = 0; |
ResourceProvider::ResourceId resource = CreateChildMailbox( |
&release_sync_point, &lost_resource, &release_called, &sync_point); |
@@ -2006,17 +2007,16 @@ TEST_P(ResourceProviderTest, LostContext) { |
gpu::Mailbox mailbox; |
context()->genMailboxCHROMIUM(mailbox.name); |
context()->produceTextureCHROMIUM(GL_TEXTURE_2D, mailbox.name); |
- unsigned sync_point = context()->insertSyncPoint(); |
+ uint32 sync_point = context()->insertSyncPoint(); |
EXPECT_LT(0u, sync_point); |
- unsigned release_sync_point = 0; |
+ uint32 release_sync_point = 0; |
bool lost_resource = false; |
scoped_ptr<SingleReleaseCallback> callback = SingleReleaseCallback::Create( |
base::Bind(ReleaseTextureMailbox, &release_sync_point, &lost_resource)); |
resource_provider_->CreateResourceFromTextureMailbox( |
- TextureMailbox(mailbox, sync_point), |
- callback.Pass()); |
+ TextureMailbox(mailbox, GL_TEXTURE_2D, sync_point), callback.Pass()); |
EXPECT_EQ(0u, release_sync_point); |
EXPECT_FALSE(lost_resource); |
@@ -2265,7 +2265,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_GLTexture2D) { |
ResourceProvider::Create(output_surface.get(), NULL, 0, false, 1)); |
unsigned texture_id = 1; |
- unsigned sync_point = 30; |
+ uint32 sync_point = 30; |
unsigned target = GL_TEXTURE_2D; |
EXPECT_CALL(*context, bindTexture(_, _)).Times(0); |
@@ -2279,7 +2279,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_GLTexture2D) { |
scoped_ptr<SingleReleaseCallback> callback = SingleReleaseCallback::Create( |
base::Bind(&EmptyReleaseCallback)); |
- TextureMailbox mailbox(gpu_mailbox, sync_point); |
+ TextureMailbox mailbox(gpu_mailbox, target, sync_point); |
ResourceProvider::ResourceId id = |
resource_provider->CreateResourceFromTextureMailbox( |
@@ -2329,7 +2329,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_GLTextureExternalOES) { |
ResourceProvider::Create(output_surface.get(), NULL, 0, false, 1)); |
unsigned texture_id = 1; |
- unsigned sync_point = 30; |
+ uint32 sync_point = 30; |
unsigned target = GL_TEXTURE_EXTERNAL_OES; |
EXPECT_CALL(*context, bindTexture(_, _)).Times(0); |