| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2011 Google Inc. | 3 * Copyright 2011 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 #include "GrContext.h" | 10 #include "GrContext.h" |
| (...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1219 // Note that internalDrawPath may sw-rasterize the path into a scratch textu
re. | 1219 // Note that internalDrawPath may sw-rasterize the path into a scratch textu
re. |
| 1220 // Scratch textures can be recycled after they are returned to the texture | 1220 // Scratch textures can be recycled after they are returned to the texture |
| 1221 // cache. This presents a potential hazard for buffered drawing. However, | 1221 // cache. This presents a potential hazard for buffered drawing. However, |
| 1222 // the writePixels that uploads to the scratch will perform a flush so we're | 1222 // the writePixels that uploads to the scratch will perform a flush so we're |
| 1223 // OK. | 1223 // OK. |
| 1224 AutoRestoreEffects are; | 1224 AutoRestoreEffects are; |
| 1225 AutoCheckFlush acf(this); | 1225 AutoCheckFlush acf(this); |
| 1226 GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf
); | 1226 GrDrawTarget* target = this->prepareToDraw(&paint, BUFFERED_DRAW, &are, &acf
); |
| 1227 GrDrawState* drawState = target->drawState(); | 1227 GrDrawState* drawState = target->drawState(); |
| 1228 | 1228 |
| 1229 GR_CREATE_TRACE_MARKER("GrContext::drawPath", target); | 1229 GR_CREATE_TRACE_MARKER1("GrContext::drawPath", target, "Is Convex", path.isC
onvex()); |
| 1230 | 1230 |
| 1231 const SkStrokeRec& strokeRec = strokeInfo.getStrokeRec(); | 1231 const SkStrokeRec& strokeRec = strokeInfo.getStrokeRec(); |
| 1232 | 1232 |
| 1233 bool useCoverageAA = paint.isAntiAlias() && !drawState->getRenderTarget()->i
sMultisampled(); | 1233 bool useCoverageAA = paint.isAntiAlias() && !drawState->getRenderTarget()->i
sMultisampled(); |
| 1234 | 1234 |
| 1235 if (useCoverageAA && strokeRec.getWidth() < 0 && !path.isConvex()) { | 1235 if (useCoverageAA && strokeRec.getWidth() < 0 && !path.isConvex()) { |
| 1236 // Concave AA paths are expensive - try to avoid them for special cases | 1236 // Concave AA paths are expensive - try to avoid them for special cases |
| 1237 bool useVertexCoverage; | 1237 bool useVertexCoverage; |
| 1238 SkRect rects[2]; | 1238 SkRect rects[2]; |
| 1239 | 1239 |
| (...skipping 694 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 fDrawBuffer->removeGpuTraceMarker(marker); | 1934 fDrawBuffer->removeGpuTraceMarker(marker); |
| 1935 } | 1935 } |
| 1936 } | 1936 } |
| 1937 | 1937 |
| 1938 /////////////////////////////////////////////////////////////////////////////// | 1938 /////////////////////////////////////////////////////////////////////////////// |
| 1939 #if GR_CACHE_STATS | 1939 #if GR_CACHE_STATS |
| 1940 void GrContext::printCacheStats() const { | 1940 void GrContext::printCacheStats() const { |
| 1941 fResourceCache->printStats(); | 1941 fResourceCache->printStats(); |
| 1942 } | 1942 } |
| 1943 #endif | 1943 #endif |
| OLD | NEW |