OLD | NEW |
1 | 1 |
2 /* | 2 /* |
3 * Copyright 2010 Google Inc. | 3 * Copyright 2010 Google Inc. |
4 * | 4 * |
5 * Use of this source code is governed by a BSD-style license that can be | 5 * Use of this source code is governed by a BSD-style license that can be |
6 * found in the LICENSE file. | 6 * found in the LICENSE file. |
7 */ | 7 */ |
8 | 8 |
9 | 9 |
10 | 10 |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 this->reset(); | 811 this->reset(); |
812 } | 812 } |
813 | 813 |
814 bool GrDrawTarget::AutoReleaseGeometry::set(GrDrawTarget* target, | 814 bool GrDrawTarget::AutoReleaseGeometry::set(GrDrawTarget* target, |
815 int vertexCount, | 815 int vertexCount, |
816 int indexCount) { | 816 int indexCount) { |
817 this->reset(); | 817 this->reset(); |
818 fTarget = target; | 818 fTarget = target; |
819 bool success = true; | 819 bool success = true; |
820 if (fTarget) { | 820 if (fTarget) { |
821 fTarget = target; | |
822 success = target->reserveVertexAndIndexSpace(vertexCount, | 821 success = target->reserveVertexAndIndexSpace(vertexCount, |
823 indexCount, | 822 indexCount, |
824 &fVertices, | 823 &fVertices, |
825 &fIndices); | 824 &fIndices); |
826 if (!success) { | 825 if (!success) { |
827 fTarget = NULL; | 826 fTarget = NULL; |
828 this->reset(); | 827 this->reset(); |
829 } | 828 } |
830 } | 829 } |
831 SkASSERT(success == SkToBool(fTarget)); | 830 SkASSERT(success == SkToBool(fTarget)); |
(...skipping 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1141 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); | 1140 SkASSERT(!fConfigTextureSupport[kUnknown_GrPixelConfig]); |
1142 | 1141 |
1143 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { | 1142 for (size_t i = 1; i < SK_ARRAY_COUNT(kConfigNames); ++i) { |
1144 r.appendf("%s is uploadable to a texture: %s\n", | 1143 r.appendf("%s is uploadable to a texture: %s\n", |
1145 kConfigNames[i], | 1144 kConfigNames[i], |
1146 gNY[fConfigTextureSupport[i]]); | 1145 gNY[fConfigTextureSupport[i]]); |
1147 } | 1146 } |
1148 | 1147 |
1149 return r; | 1148 return r; |
1150 } | 1149 } |
OLD | NEW |