Home | History | Annotate | Download | only in resources

Lines Matching refs:textures

130   // Create textures for double our memory limit.
131 scoped_ptr<PrioritizedResource> textures[kMaxTextures * 2];
134 textures[i] =
139 textures[i]->set_request_priority(100 + i);
143 EXPECT_TRUE(ValidateTexture(textures[0].get(), false));
144 EXPECT_TRUE(ValidateTexture(textures[7].get(), false));
145 EXPECT_FALSE(ValidateTexture(textures[8].get(), false));
146 EXPECT_FALSE(ValidateTexture(textures[15].get(), false));
150 textures[i]->set_request_priority(100 - i);
154 EXPECT_FALSE(ValidateTexture(textures[0].get(), false));
155 EXPECT_FALSE(ValidateTexture(textures[7].get(), false));
156 EXPECT_TRUE(ValidateTexture(textures[8].get(), false));
157 EXPECT_TRUE(ValidateTexture(textures[15].get(), false));
175 scoped_ptr<PrioritizedResource> textures[kMaxTextures];
178 textures[i] =
182 textures[i]->set_request_priority(100 + i);
184 // Set max limit to 8 textures
188 ValidateTexture(textures[i].get(), false);
199 // Set max limit to 5 textures
203 EXPECT_EQ(ValidateTexture(textures[i].get(), false), i < 5);
216 // Set max limit to 4 textures
220 EXPECT_EQ(ValidateTexture(textures[i].get(), false), i < 4);
242 scoped_ptr<PrioritizedResource> textures[kMaxTextures];
245 textures[i] =
249 textures[i]->set_request_priority(100 + i);
251 // Set the memory limit to the max number of textures.
255 // Create backings and textures for all of the textures.
257 ValidateTexture(textures[i].get(), false);
263 textures[i]->SetPixels(resource_provider_.get(),
276 // 20 textures have backings allocated.
280 textures[0] = scoped_ptr<PrioritizedResource>();
290 // Destroy half the textures, leaving behind the backings. Now a cleanup
293 textures[i] = scoped_ptr<PrioritizedResource>();
312 scoped_ptr<PrioritizedResource> textures[kMaxTextures];
315 textures[i] =
319 textures[i]->set_request_priority(100 + i);
321 // Set the memory limit to the max number of textures.
325 // Create backings and textures for all of the textures.
327 ValidateTexture(textures[i].get(), false);
333 textures[i]->SetPixels(resource_provider_.get(),
346 // 20 textures have backings allocated.
349 // Send half the textures to a parent compositor.
353 to_send.push_back(textures[i]->resource_id());
356 // Destroy half the textures, leaving behind the backings. The backings are
360 textures[i] = scoped_ptr<PrioritizedResource>();
370 // Receive the textures back from the parent compositor. Now a cleanup should
392 scoped_ptr<PrioritizedResource> textures[kMaxTextures];
395 textures[i] =
399 textures[i]->set_request_priority(100 + i);
401 // Set the cutoff to drop two textures. Try to request_late on all textures,
408 EXPECT_EQ(ValidateTexture(textures[i].get(), true), i < 6);
418 // Set the cutoff to drop two more textures.
422 textures[i].get(), false), i < 4);
448 EXPECT_EQ(ValidateTexture(textures[i].get(), false), i < 4);
465 scoped_ptr<PrioritizedResource> textures[kMaxTextures];
469 textures[i] =
471 textures[i]->set_request_priority(100 + i);
476 EXPECT_TRUE(ValidateTexture(textures[i].get(), true));
482 textures[i]->SetPixels(resource_provider_.get(),
497 texture_resource_ids[i] = textures[i]->resource_id();
499 // Evict four textures. It will be the last four.
529 EXPECT_TRUE(ValidateTexture(textures[i].get(), true));
535 textures[i]->SetPixels(resource_provider_.get(),
549 // Send the last two of the textures to a parent compositor.
553 to_send.push_back(textures[i]->resource_id());
556 // Set the last two textures to be tied for prioity with the two
558 textures[4]->set_request_priority(100 + 4);
559 textures[5]->set_request_priority(100 + 5);
560 textures[6]->set_request_priority(100 + 4);
561 textures[7]->set_request_priority(100 + 5);
564 texture_resource_ids[i] = textures[i]->resource_id();
566 // Drop all the textures. Now we have backings that can be recycled.
568 textures[0].reset();
578 // Evict four textures. It would be the last four again, except that 2 of them
609 scoped_ptr<PrioritizedResource> textures[kNumTextures];
613 textures[i] =
620 textures[i]->set_request_priority(200 + i);
623 // Allocate textures which are currently high priority.
624 EXPECT_TRUE(ValidateTexture(textures[0].get(), false));
625 EXPECT_TRUE(ValidateTexture(textures[1].get(), false));
626 EXPECT_TRUE(ValidateTexture(textures[2].get(), false));
627 EXPECT_TRUE(ValidateTexture(textures[3].get(), false));
629 EXPECT_TRUE(textures[0]->have_backing_texture());
630 EXPECT_TRUE(textures[1]->have_backing_texture());
631 EXPECT_TRUE(textures[2]->have_backing_texture());
632 EXPECT_TRUE(textures[3]->have_backing_texture());
638 // Textures are now below cutoff.
639 EXPECT_FALSE(ValidateTexture(textures[0].get(), false));
640 EXPECT_FALSE(ValidateTexture(textures[1].get(), false));
641 EXPECT_FALSE(ValidateTexture(textures[2].get(), false));
642 EXPECT_FALSE(ValidateTexture(textures[3].get(), false));
645 EXPECT_TRUE(textures[0]->have_backing_texture());
646 EXPECT_TRUE(textures[1]->have_backing_texture());
647 EXPECT_TRUE(textures[2]->have_backing_texture());
648 EXPECT_TRUE(textures[3]->have_backing_texture());
650 // Higher priority textures are finally needed.
657 EXPECT_FALSE(textures[0]->have_backing_texture());
658 EXPECT_FALSE(textures[1]->have_backing_texture());
659 EXPECT_FALSE(textures[2]->have_backing_texture());
660 EXPECT_FALSE(textures[3]->have_backing_texture());
671 scoped_ptr<PrioritizedResource> textures[kMaxTextures];
674 textures[i] =
678 // All 16 textures have the same priority except 2 higher priority.
680 textures[i]->set_request_priority(100);
681 textures[0]->set_request_priority(99);
682 textures[1]->set_request_priority(99);
684 // Set max limit to 8 textures
688 // The two high priority textures should be available, others should not.
690 EXPECT_TRUE(ValidateTexture(textures[i].get(), false));
692 EXPECT_FALSE(ValidateTexture(textures[i].get(), false));
697 // Manually reserving textures should only succeed on the higher priority
698 // textures, and on remaining textures up to the memory limit.
700 EXPECT_TRUE(ValidateTexture(textures[i].get(), true));
702 EXPECT_FALSE(ValidateTexture(textures[i].get(), true));
793 // Create textures to fill our memory limit.
794 scoped_ptr<PrioritizedResource> textures[kMaxTextures];
797 textures[i] =
803 textures[i]->set_request_priority(100 + i);
807 EXPECT_TRUE(ValidateTexture(textures[0].get(), false));
808 EXPECT_TRUE(ValidateTexture(textures[3].get(), false));
809 EXPECT_FALSE(ValidateTexture(textures[4].get(), false));
810 EXPECT_FALSE(ValidateTexture(textures[7].get(), false));
814 textures[i]->set_request_priority(100 - i);
818 EXPECT_FALSE(ValidateTexture(textures[0].get(), false));
819 EXPECT_FALSE(ValidateTexture(textures[3].get(), false));
820 EXPECT_TRUE(ValidateTexture(textures[4].get(), false));
821 EXPECT_TRUE(ValidateTexture(textures[7].get(), false));
850 // Create textures to fill our memory limit.
851 scoped_ptr<PrioritizedResource> textures[kMaxTextures];
854 textures[i] =
860 textures[i]->set_request_priority(100);
865 EXPECT_FALSE(ValidateTexture(textures[i].get(), false));
867 EXPECT_TRUE(ValidateTexture(textures[i].get(), true));
869 EXPECT_FALSE(ValidateTexture(textures[i].get(), true));
898 // Create textures to fill our memory limit.
899 scoped_ptr<PrioritizedResource> textures[kMaxTextures];
902 textures[i] =
905 // Set 6 visible textures in the root surface, and 2 in a child surface.
907 textures[i]->
911 textures[i]->
917 // Unable to request_late textures in the child surface.
918 EXPECT_FALSE(ValidateTexture(textures[6].get(), true));
919 EXPECT_FALSE(ValidateTexture(textures[7].get(), true));
921 // Root surface textures are valid.
923 EXPECT_TRUE(ValidateTexture(textures[i].get(), false));
942 // Create textures to fill our memory limit.
943 scoped_ptr<PrioritizedResource> textures[kMaxTextures];
945 textures[i] =
948 // Set equal priorities, and allocate backings for all textures.
950 textures[i]->set_request_priority(100);
953 EXPECT_TRUE(ValidateTexture(textures[i].get(), false));
963 EXPECT_TRUE(textures[i]->RequestLate());
972 // Make sure that we have backings for all of the textures.
974 EXPECT_TRUE(textures[i]->have_backing_texture());
976 // Make sure that only the request_late textures are above the priority
979 EXPECT_TRUE(TextureBackingIsAbovePriorityCutoff(textures[i].get()));
981 EXPECT_FALSE(TextureBackingIsAbovePriorityCutoff(textures[i].get()));
994 // Create textures to fill our memory limit.
995 scoped_ptr<PrioritizedResource> textures[kMaxTextures];
998 textures[i] =
1001 // Set equal priorities, and allocate backings for all textures.
1003 textures[i]->set_request_priority(100);
1006 EXPECT_TRUE(ValidateTexture(textures[i].get(), false));
1013 textures[i].get(), NULL, gfx::Rect(), gfx::Rect(), gfx::Vector2d());
1017 // Make sure that we have backings for all of the textures.
1019 EXPECT_TRUE(textures[i]->have_backing_texture());
1041 scoped_ptr<PrioritizedResource> textures[kMaxTextures];
1044 textures[i] =
1048 textures[0]->
1050 textures[1]->
1052 textures[2]->set_request_priority(
1054 textures[3]->
1056 textures[4]->set_request_priority(
1059 // Set max limit to 2 textures.
1063 // The first two textures should be available, others should not.
1065 EXPECT_TRUE(ValidateTexture(textures[i].get(), false));
1067 EXPECT_FALSE(ValidateTexture(textures[i].get(), false));
1078 // Re-prioritize the textures, but do not push the values to backings.
1079 textures[0]->
1081 textures[1]->
1083 textures[2]->
1085 textures[3]->set_request_priority(
1087 textures[4]->