Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(157)

Unified Diff: cc/resources/resource_provider_unittest.cc

Issue 1230203007: Re-land: cc: Use worker context for one-copy tile initialization. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | cc/surfaces/display.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/resource_provider_unittest.cc
diff --git a/cc/resources/resource_provider_unittest.cc b/cc/resources/resource_provider_unittest.cc
index 4a02e828dcb79b611be09838cc0ed47389ef1ed8..7c65b73098b208ec4ed2916383c0deb148867ffc 100644
--- a/cc/resources/resource_provider_unittest.cc
+++ b/cc/resources/resource_provider_unittest.cc
@@ -422,11 +422,11 @@ class ResourceProviderTest
resource_provider_ = ResourceProvider::Create(
output_surface_.get(), shared_bitmap_manager_.get(),
gpu_memory_buffer_manager_.get(), main_thread_task_runner_.get(), 0,
- false, 1, false, use_image_texture_targets_);
+ false, 1, use_image_texture_targets_);
child_resource_provider_ = ResourceProvider::Create(
child_output_surface_.get(), shared_bitmap_manager_.get(),
gpu_memory_buffer_manager_.get(), main_thread_task_runner_.get(), 0,
- false, 1, false, use_image_texture_targets_);
+ false, 1, use_image_texture_targets_);
}
ResourceProviderTest() : ResourceProviderTest(true) {}
@@ -1378,7 +1378,7 @@ TEST_P(ResourceProviderTest, TransferGLToSoftware) {
scoped_ptr<ResourceProvider> child_resource_provider(ResourceProvider::Create(
child_output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
gfx::Size size(1, 1);
@@ -1863,7 +1863,7 @@ class ResourceProviderTestTextureFilters : public ResourceProviderTest {
scoped_ptr<ResourceProvider> child_resource_provider(
ResourceProvider::Create(child_output_surface.get(),
shared_bitmap_manager.get(), NULL, NULL, 0,
- false, 1, false, use_image_texture_targets_));
+ false, 1, use_image_texture_targets_));
scoped_ptr<TextureStateTrackingContext> parent_context_owned(
new TextureStateTrackingContext);
@@ -1877,7 +1877,7 @@ class ResourceProviderTestTextureFilters : public ResourceProviderTest {
scoped_ptr<ResourceProvider> parent_resource_provider(
ResourceProvider::Create(parent_output_surface.get(),
shared_bitmap_manager.get(), NULL, NULL, 0,
- false, 1, false, use_image_texture_targets_));
+ false, 1, use_image_texture_targets_));
gfx::Size size(1, 1);
ResourceFormat format = RGBA_8888;
@@ -2509,7 +2509,7 @@ TEST_P(ResourceProviderTest, ScopedSampler) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
gfx::Size size(1, 1);
@@ -2592,7 +2592,7 @@ TEST_P(ResourceProviderTest, ManagedResource) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
gfx::Size size(1, 1);
@@ -2640,7 +2640,7 @@ TEST_P(ResourceProviderTest, TextureWrapMode) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
gfx::Size size(1, 1);
@@ -2691,7 +2691,7 @@ TEST_P(ResourceProviderTest, TextureHint) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
gfx::Size size(1, 1);
@@ -2757,7 +2757,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_SharedMemory) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
gpu_memory_buffer_manager_.get(), main_thread_task_runner_.get(), 0,
- false, 1, false, use_image_texture_targets_));
+ false, 1, use_image_texture_targets_));
uint32 release_sync_point = 0;
bool lost_resource = false;
@@ -2806,8 +2806,7 @@ class ResourceProviderTestTextureMailboxGLFilters
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager, gpu_memory_buffer_manager,
- main_thread_task_runner, 0, false, 1, false,
- use_image_texture_targets_));
+ main_thread_task_runner, 0, false, 1, use_image_texture_targets_));
unsigned texture_id = 1;
uint32 sync_point = 30;
@@ -2950,7 +2949,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_GLTextureExternalOES) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
uint32 sync_point = 30;
@@ -3020,7 +3019,7 @@ TEST_P(ResourceProviderTest,
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
uint32 sync_point = 30;
@@ -3074,7 +3073,7 @@ TEST_P(ResourceProviderTest, TextureMailbox_WaitSyncPointIfNeeded_NoSyncPoint) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
uint32 sync_point = 0;
@@ -3195,7 +3194,7 @@ TEST_P(ResourceProviderTest, TextureAllocation) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
gfx::Size size(2, 2);
@@ -3270,7 +3269,7 @@ TEST_P(ResourceProviderTest, TextureAllocationHint) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
gfx::Size size(2, 2);
@@ -3326,7 +3325,7 @@ TEST_P(ResourceProviderTest, TextureAllocationHint_BGRA) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
gfx::Size size(2, 2);
@@ -3381,7 +3380,7 @@ TEST_P(ResourceProviderTest, PixelBuffer_GLTexture) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
id = resource_provider->CreateResource(
@@ -3424,7 +3423,7 @@ TEST_P(ResourceProviderTest, ForcingAsyncUploadToComplete) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
id = resource_provider->CreateResource(
@@ -3467,7 +3466,7 @@ TEST_P(ResourceProviderTest, PixelBufferLostContext) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
EXPECT_CALL(*context, NextTextureId()).WillRepeatedly(Return(texture_id));
@@ -3508,7 +3507,7 @@ TEST_P(ResourceProviderTest, Image_GLTexture) {
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
id = resource_provider->CreateResource(
@@ -3569,89 +3568,6 @@ TEST_P(ResourceProviderTest, Image_GLTexture) {
.RetiresOnSaturation();
}
-TEST_P(ResourceProviderTest, CopyResource_GLTexture) {
- if (GetParam() != ResourceProvider::RESOURCE_TYPE_GL_TEXTURE)
- return;
- scoped_ptr<AllocationTrackingContext3D> context_owned(
- new StrictMock<AllocationTrackingContext3D>);
- AllocationTrackingContext3D* context = context_owned.get();
- context_owned->set_support_sync_query(true);
-
- FakeOutputSurfaceClient output_surface_client;
- scoped_ptr<OutputSurface> output_surface(
- FakeOutputSurface::Create3d(context_owned.Pass()));
- ASSERT_TRUE(output_surface->BindToClient(&output_surface_client));
-
- const int kWidth = 2;
- const int kHeight = 2;
- gfx::Size size(kWidth, kHeight);
- ResourceFormat format = RGBA_8888;
- ResourceId source_id = 0;
- ResourceId dest_id = 0;
- const unsigned kSourceTextureId = 123u;
- const unsigned kDestTextureId = 321u;
- const unsigned kImageId = 234u;
-
- scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
- output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
- std::vector<unsigned>(static_cast<size_t>(gfx::BufferFormat::LAST) + 1,
- GL_TEXTURE_2D)));
-
- source_id = resource_provider->CreateResource(
- size, GL_CLAMP_TO_EDGE, ResourceProvider::TEXTURE_HINT_IMMUTABLE, format);
-
- EXPECT_CALL(*context, NextTextureId())
- .WillOnce(Return(kSourceTextureId))
- .RetiresOnSaturation();
- EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, kSourceTextureId))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*context, createImageCHROMIUM(_, kWidth, kHeight, GL_RGBA))
- .WillOnce(Return(kImageId))
- .RetiresOnSaturation();
- {
- ResourceProvider::ScopedWriteLockGpuMemoryBuffer lock(
- resource_provider.get(), source_id);
- EXPECT_TRUE(lock.GetGpuMemoryBuffer());
- }
- Mock::VerifyAndClearExpectations(context);
-
- dest_id = resource_provider->CreateResource(
- size, GL_CLAMP_TO_EDGE, ResourceProvider::TEXTURE_HINT_IMMUTABLE, format);
-
- EXPECT_CALL(*context, NextTextureId())
- .WillOnce(Return(kDestTextureId))
- .RetiresOnSaturation();
- EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, kDestTextureId))
- .Times(2)
- .RetiresOnSaturation();
- EXPECT_CALL(*context, texImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA,
- GL_UNSIGNED_BYTE, nullptr))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*context, bindTexture(GL_TEXTURE_2D, kSourceTextureId))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*context, bindTexImage2DCHROMIUM(GL_TEXTURE_2D, kImageId))
- .Times(1)
- .RetiresOnSaturation();
- resource_provider->CopyResource(source_id, dest_id, gfx::Rect(size));
- Mock::VerifyAndClearExpectations(context);
-
- EXPECT_CALL(*context, destroyImageCHROMIUM(kImageId))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*context, RetireTextureId(kSourceTextureId))
- .Times(1)
- .RetiresOnSaturation();
- EXPECT_CALL(*context, RetireTextureId(kDestTextureId))
- .Times(1)
- .RetiresOnSaturation();
- resource_provider->DeleteResource(source_id);
- resource_provider->DeleteResource(dest_id);
-}
-
TEST_P(ResourceProviderTest, CompressedTextureETC1Allocate) {
if (GetParam() != ResourceProvider::RESOURCE_TYPE_GL_TEXTURE)
return;
@@ -3669,7 +3585,7 @@ TEST_P(ResourceProviderTest, CompressedTextureETC1Allocate) {
gfx::Size size(4, 4);
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
int texture_id = 123;
@@ -3701,7 +3617,7 @@ TEST_P(ResourceProviderTest, CompressedTextureETC1Upload) {
gfx::Size size(4, 4);
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager_.get(),
- gpu_memory_buffer_manager_.get(), NULL, 0, false, 1, false,
+ gpu_memory_buffer_manager_.get(), NULL, 0, false, 1,
use_image_texture_targets_));
int texture_id = 123;
uint8_t pixels[8];
@@ -3758,7 +3674,7 @@ TEST(ResourceProviderTest, TextureAllocationChunkSize) {
size_t kTextureAllocationChunkSize = 1;
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager.get(), NULL, NULL, 0, false,
- kTextureAllocationChunkSize, false,
+ kTextureAllocationChunkSize,
ResourceProviderTest::use_image_texture_targets()));
ResourceId id = resource_provider->CreateResource(
@@ -3775,7 +3691,7 @@ TEST(ResourceProviderTest, TextureAllocationChunkSize) {
size_t kTextureAllocationChunkSize = 8;
scoped_ptr<ResourceProvider> resource_provider(ResourceProvider::Create(
output_surface.get(), shared_bitmap_manager.get(), NULL, NULL, 0, false,
- kTextureAllocationChunkSize, false,
+ kTextureAllocationChunkSize,
ResourceProviderTest::use_image_texture_targets()));
ResourceId id = resource_provider->CreateResource(
« no previous file with comments | « cc/resources/resource_provider.cc ('k') | cc/surfaces/display.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698