OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #if SK_SUPPORT_GPU | 8 #if SK_SUPPORT_GPU |
9 | 9 |
10 #include "GrContext.h" | 10 #include "GrContext.h" |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 REPORTER_ASSERT(reporter, smallRT0 && bigRT && | 97 REPORTER_ASSERT(reporter, smallRT0 && bigRT && |
98 smallRT0->asRenderTarget() && bigRT->asRenderTarge
t() && | 98 smallRT0->asRenderTarget() && bigRT->asRenderTarge
t() && |
99 smallRT0->asRenderTarget()->getStencilBuffer() != | 99 smallRT0->asRenderTarget()->getStencilBuffer() != |
100 bigRT->asRenderTarget()->getStencilBuffer()); | 100 bigRT->asRenderTarget()->getStencilBuffer()); |
101 | 101 |
102 if (context->getMaxSampleCount() >= 4) { | 102 if (context->getMaxSampleCount() >= 4) { |
103 // An RT with a different sample count should not share. | 103 // An RT with a different sample count should not share. |
104 GrSurfaceDesc smallMSAADesc = smallDesc; | 104 GrSurfaceDesc smallMSAADesc = smallDesc; |
105 smallMSAADesc.fSampleCnt = 4; | 105 smallMSAADesc.fSampleCnt = 4; |
106 SkAutoTUnref<GrTexture> smallMSAART0(context->createTexture(smallMSAADes
c, false)); | 106 SkAutoTUnref<GrTexture> smallMSAART0(context->createTexture(smallMSAADes
c, false)); |
| 107 #ifdef SK_BUILD_FOR_ANDROID |
| 108 if (!smallMSAART0) { |
| 109 // The nexus player seems to fail to create MSAA textures. |
| 110 return; |
| 111 } |
| 112 #endif |
107 REPORTER_ASSERT(reporter, smallRT0 && smallMSAART0 && | 113 REPORTER_ASSERT(reporter, smallRT0 && smallMSAART0 && |
108 smallRT0->asRenderTarget() && smallMSAART0->as
RenderTarget() && | 114 smallRT0->asRenderTarget() && smallMSAART0->as
RenderTarget() && |
109 smallRT0->asRenderTarget()->getStencilBuffer()
!= | 115 smallRT0->asRenderTarget()->getStencilBuffer()
!= |
110 smallMSAART0->asRenderTarget()->getStencilBuff
er()); | 116 smallMSAART0->asRenderTarget()->getStencilBuff
er()); |
111 // A second MSAA RT should share with the first MSAA RT. | 117 // A second MSAA RT should share with the first MSAA RT. |
112 SkAutoTUnref<GrTexture> smallMSAART1(context->createTexture(smallMSAADes
c, false)); | 118 SkAutoTUnref<GrTexture> smallMSAART1(context->createTexture(smallMSAADes
c, false)); |
113 REPORTER_ASSERT(reporter, smallMSAART0 && smallMSAART1 && | 119 REPORTER_ASSERT(reporter, smallMSAART0 && smallMSAART1 && |
114 smallMSAART0->asRenderTarget() && | 120 smallMSAART0->asRenderTarget() && |
115 smallMSAART1->asRenderTarget() && | 121 smallMSAART1->asRenderTarget() && |
116 smallMSAART0->asRenderTarget()->getStencilBuff
er() == | 122 smallMSAART0->asRenderTarget()->getStencilBuff
er() == |
(...skipping 963 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1080 test_remove_scratch_key(reporter); | 1086 test_remove_scratch_key(reporter); |
1081 test_scratch_key_consistency(reporter); | 1087 test_scratch_key_consistency(reporter); |
1082 test_purge_invalidated(reporter); | 1088 test_purge_invalidated(reporter); |
1083 test_cache_chained_purge(reporter); | 1089 test_cache_chained_purge(reporter); |
1084 test_resource_size_changed(reporter); | 1090 test_resource_size_changed(reporter); |
1085 test_timestamp_wrap(reporter); | 1091 test_timestamp_wrap(reporter); |
1086 test_large_resource_count(reporter); | 1092 test_large_resource_count(reporter); |
1087 } | 1093 } |
1088 | 1094 |
1089 #endif | 1095 #endif |
OLD | NEW |