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

Side by Side Diff: cc/layer_tree_host_impl_unittest.cc

Issue 12210077: cc: Disable RenderSurface caching. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: RebasedTOHead Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « cc/direct_renderer.cc ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 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/layer_tree_host_impl.h" 5 #include "cc/layer_tree_host_impl.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 2734 matching lines...) Expand 10 before | Expand all | Expand 10 after
2745 2745
2746 class GLRendererWithReleaseTextures : public GLRenderer { 2746 class GLRendererWithReleaseTextures : public GLRenderer {
2747 public: 2747 public:
2748 using GLRenderer::releaseRenderPassTextures; 2748 using GLRenderer::releaseRenderPassTextures;
2749 }; 2749 };
2750 2750
2751 TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusion) 2751 TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusion)
2752 { 2752 {
2753 LayerTreeSettings settings; 2753 LayerTreeSettings settings;
2754 settings.minimumOcclusionTrackingSize = gfx::Size(); 2754 settings.minimumOcclusionTrackingSize = gfx::Size();
2755 settings.cacheRenderPassContents = true;
2755 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy); 2756 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy);
2756 2757
2757 // Layers are structure as follows: 2758 // Layers are structure as follows:
2758 // 2759 //
2759 // R +-- S1 +- L10 (owning) 2760 // R +-- S1 +- L10 (owning)
2760 // | +- L11 2761 // | +- L11
2761 // | +- L12 2762 // | +- L12
2762 // | 2763 // |
2763 // +-- S2 +- L20 (owning) 2764 // +-- S2 +- L20 (owning)
2764 // +- L21 2765 // +- L21
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
2859 myHostImpl->drawLayers(frame); 2860 myHostImpl->drawLayers(frame);
2860 myHostImpl->didDrawAllLayers(frame); 2861 myHostImpl->didDrawAllLayers(frame);
2861 } 2862 }
2862 2863
2863 } 2864 }
2864 2865
2865 TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut) 2866 TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionEarlyOut)
2866 { 2867 {
2867 LayerTreeSettings settings; 2868 LayerTreeSettings settings;
2868 settings.minimumOcclusionTrackingSize = gfx::Size(); 2869 settings.minimumOcclusionTrackingSize = gfx::Size();
2870 settings.cacheRenderPassContents = true;
2869 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy); 2871 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy);
2870 2872
2871 // Layers are structure as follows: 2873 // Layers are structure as follows:
2872 // 2874 //
2873 // R +-- S1 +- L10 (owning, non drawing) 2875 // R +-- S1 +- L10 (owning, non drawing)
2874 // | +- L11 (corner, unoccluded) 2876 // | +- L11 (corner, unoccluded)
2875 // | +- L12 (corner, unoccluded) 2877 // | +- L12 (corner, unoccluded)
2876 // | +- L13 (corner, unoccluded) 2878 // | +- L13 (corner, unoccluded)
2877 // | +- L14 (corner, entirely occluded) 2879 // | +- L14 (corner, entirely occluded)
2878 // | 2880 // |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
2973 2975
2974 myHostImpl->drawLayers(frame); 2976 myHostImpl->drawLayers(frame);
2975 myHostImpl->didDrawAllLayers(frame); 2977 myHostImpl->didDrawAllLayers(frame);
2976 } 2978 }
2977 } 2979 }
2978 2980
2979 TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal) 2981 TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalOverInternal)
2980 { 2982 {
2981 LayerTreeSettings settings; 2983 LayerTreeSettings settings;
2982 settings.minimumOcclusionTrackingSize = gfx::Size(); 2984 settings.minimumOcclusionTrackingSize = gfx::Size();
2985 settings.cacheRenderPassContents = true;
2983 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy); 2986 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy);
2984 2987
2985 // Layers are structured as follows: 2988 // Layers are structured as follows:
2986 // 2989 //
2987 // R +-- S1 +- L10 (owning, drawing) 2990 // R +-- S1 +- L10 (owning, drawing)
2988 // | +- L11 (corner, occluded by L12) 2991 // | +- L11 (corner, occluded by L12)
2989 // | +- L12 (opposite corner) 2992 // | +- L12 (opposite corner)
2990 // | 2993 // |
2991 // +-- S2 +- L20 (owning, drawing) 2994 // +-- S2 +- L20 (owning, drawing)
2992 // 2995 //
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
3059 EXPECT_EQ(2U, frame.renderPasses[1]->quad_list.size()); 3062 EXPECT_EQ(2U, frame.renderPasses[1]->quad_list.size());
3060 3063
3061 myHostImpl->drawLayers(frame); 3064 myHostImpl->drawLayers(frame);
3062 myHostImpl->didDrawAllLayers(frame); 3065 myHostImpl->didDrawAllLayers(frame);
3063 } 3066 }
3064 } 3067 }
3065 3068
3066 TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned) 3069 TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionExternalNotAligned)
3067 { 3070 {
3068 LayerTreeSettings settings; 3071 LayerTreeSettings settings;
3072 settings.cacheRenderPassContents = true;
3069 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy); 3073 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy);
3070 3074
3071 // Layers are structured as follows: 3075 // Layers are structured as follows:
3072 // 3076 //
3073 // R +-- S1 +- L10 (rotated, drawing) 3077 // R +-- S1 +- L10 (rotated, drawing)
3074 // +- L11 (occupies half surface) 3078 // +- L11 (occupies half surface)
3075 3079
3076 LayerImpl* rootPtr; 3080 LayerImpl* rootPtr;
3077 LayerImpl* layerS1Ptr; 3081 LayerImpl* layerS1Ptr;
3078 3082
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
3133 myHostImpl->drawLayers(frame); 3137 myHostImpl->drawLayers(frame);
3134 myHostImpl->didDrawAllLayers(frame); 3138 myHostImpl->didDrawAllLayers(frame);
3135 } 3139 }
3136 } 3140 }
3137 3141
3138 TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap) 3142 TEST_P(LayerTreeHostImplTest, textureCachingWithOcclusionPartialSwap)
3139 { 3143 {
3140 LayerTreeSettings settings; 3144 LayerTreeSettings settings;
3141 settings.minimumOcclusionTrackingSize = gfx::Size(); 3145 settings.minimumOcclusionTrackingSize = gfx::Size();
3142 settings.partialSwapEnabled = true; 3146 settings.partialSwapEnabled = true;
3147 settings.cacheRenderPassContents = true;
3143 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy); 3148 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy);
3144 3149
3145 // Layers are structure as follows: 3150 // Layers are structure as follows:
3146 // 3151 //
3147 // R +-- S1 +- L10 (owning) 3152 // R +-- S1 +- L10 (owning)
3148 // | +- L11 3153 // | +- L11
3149 // | +- L12 3154 // | +- L12
3150 // | 3155 // |
3151 // +-- S2 +- L20 (owning) 3156 // +-- S2 +- L20 (owning)
3152 // +- L21 3157 // +- L21
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
3244 3249
3245 myHostImpl->drawLayers(frame); 3250 myHostImpl->drawLayers(frame);
3246 myHostImpl->didDrawAllLayers(frame); 3251 myHostImpl->didDrawAllLayers(frame);
3247 } 3252 }
3248 } 3253 }
3249 3254
3250 TEST_P(LayerTreeHostImplTest, textureCachingWithScissor) 3255 TEST_P(LayerTreeHostImplTest, textureCachingWithScissor)
3251 { 3256 {
3252 LayerTreeSettings settings; 3257 LayerTreeSettings settings;
3253 settings.minimumOcclusionTrackingSize = gfx::Size(); 3258 settings.minimumOcclusionTrackingSize = gfx::Size();
3259 settings.cacheRenderPassContents = true;
3254 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy); 3260 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy);
3255 3261
3256 /* 3262 /*
3257 Layers are created as follows: 3263 Layers are created as follows:
3258 3264
3259 +--------------------+ 3265 +--------------------+
3260 | 1 | 3266 | 1 |
3261 | +-----------+ | 3267 | +-----------+ |
3262 | | 2 | | 3268 | | 2 | |
3263 | | +-------------------+ 3269 | | +-------------------+
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
3350 3356
3351 // We should have a cached texture for surface 2 again even though it was da maged. 3357 // We should have a cached texture for surface 2 again even though it was da maged.
3352 EXPECT_TRUE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(child PassId)); 3358 EXPECT_TRUE(myHostImpl->renderer()->haveCachedResourcesForRenderPassId(child PassId));
3353 } 3359 }
3354 3360
3355 TEST_P(LayerTreeHostImplTest, surfaceTextureCaching) 3361 TEST_P(LayerTreeHostImplTest, surfaceTextureCaching)
3356 { 3362 {
3357 LayerTreeSettings settings; 3363 LayerTreeSettings settings;
3358 settings.minimumOcclusionTrackingSize = gfx::Size(); 3364 settings.minimumOcclusionTrackingSize = gfx::Size();
3359 settings.partialSwapEnabled = true; 3365 settings.partialSwapEnabled = true;
3366 settings.cacheRenderPassContents = true;
3360 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy); 3367 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy);
3361 3368
3362 LayerImpl* rootPtr; 3369 LayerImpl* rootPtr;
3363 LayerImpl* intermediateLayerPtr; 3370 LayerImpl* intermediateLayerPtr;
3364 LayerImpl* surfaceLayerPtr; 3371 LayerImpl* surfaceLayerPtr;
3365 LayerImpl* childPtr; 3372 LayerImpl* childPtr;
3366 3373
3367 setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr , surfaceLayerPtr, childPtr, gfx::Size(100, 100)); 3374 setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr , surfaceLayerPtr, childPtr, gfx::Size(100, 100));
3368 3375
3369 { 3376 {
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
3508 3515
3509 myHostImpl->drawLayers(frame); 3516 myHostImpl->drawLayers(frame);
3510 myHostImpl->didDrawAllLayers(frame); 3517 myHostImpl->didDrawAllLayers(frame);
3511 } 3518 }
3512 } 3519 }
3513 3520
3514 TEST_P(LayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap) 3521 TEST_P(LayerTreeHostImplTest, surfaceTextureCachingNoPartialSwap)
3515 { 3522 {
3516 LayerTreeSettings settings; 3523 LayerTreeSettings settings;
3517 settings.minimumOcclusionTrackingSize = gfx::Size(); 3524 settings.minimumOcclusionTrackingSize = gfx::Size();
3525 settings.cacheRenderPassContents = true;
3518 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy); 3526 scoped_ptr<LayerTreeHostImpl> myHostImpl = LayerTreeHostImpl::create(setting s, this, &m_proxy);
3519 3527
3520 LayerImpl* rootPtr; 3528 LayerImpl* rootPtr;
3521 LayerImpl* intermediateLayerPtr; 3529 LayerImpl* intermediateLayerPtr;
3522 LayerImpl* surfaceLayerPtr; 3530 LayerImpl* surfaceLayerPtr;
3523 LayerImpl* childPtr; 3531 LayerImpl* childPtr;
3524 3532
3525 setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr , surfaceLayerPtr, childPtr, gfx::Size(100, 100)); 3533 setupLayersForTextureCaching(myHostImpl.get(), rootPtr, intermediateLayerPtr , surfaceLayerPtr, childPtr, gfx::Size(100, 100));
3526 3534
3527 { 3535 {
(...skipping 806 matching lines...) Expand 10 before | Expand all | Expand 10 after
4334 m_hostImpl->didDrawAllLayers(frame); 4342 m_hostImpl->didDrawAllLayers(frame);
4335 } 4343 }
4336 } 4344 }
4337 4345
4338 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests, 4346 INSTANTIATE_TEST_CASE_P(LayerTreeHostImplTests,
4339 LayerTreeHostImplTest, 4347 LayerTreeHostImplTest,
4340 ::testing::Values(false, true)); 4348 ::testing::Values(false, true));
4341 4349
4342 } // namespace 4350 } // namespace
4343 } // namespace cc 4351 } // namespace cc
OLDNEW
« no previous file with comments | « cc/direct_renderer.cc ('k') | cc/layer_tree_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698