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 10 matching lines...) Expand all Loading... |
21 #include "GrInOrderDrawBuffer.h" | 21 #include "GrInOrderDrawBuffer.h" |
22 #include "GrLayerCache.h" | 22 #include "GrLayerCache.h" |
23 #include "GrOvalRenderer.h" | 23 #include "GrOvalRenderer.h" |
24 #include "GrPathRenderer.h" | 24 #include "GrPathRenderer.h" |
25 #include "GrPathUtils.h" | 25 #include "GrPathUtils.h" |
26 #include "GrResourceCache.h" | 26 #include "GrResourceCache.h" |
27 #include "GrSoftwarePathRenderer.h" | 27 #include "GrSoftwarePathRenderer.h" |
28 #include "GrStencilBuffer.h" | 28 #include "GrStencilBuffer.h" |
29 #include "GrStrokeInfo.h" | 29 #include "GrStrokeInfo.h" |
30 #include "GrTextStrike.h" | 30 #include "GrTextStrike.h" |
| 31 #include "GrTraceMarker.h" |
31 #include "GrTracing.h" | 32 #include "GrTracing.h" |
32 #include "SkDashPathPriv.h" | 33 #include "SkDashPathPriv.h" |
33 #include "SkGr.h" | 34 #include "SkGr.h" |
34 #include "SkRTConf.h" | 35 #include "SkRTConf.h" |
35 #include "SkRRect.h" | 36 #include "SkRRect.h" |
36 #include "SkStrokeRec.h" | 37 #include "SkStrokeRec.h" |
37 #include "SkTLazy.h" | 38 #include "SkTLazy.h" |
38 #include "SkTLS.h" | 39 #include "SkTLS.h" |
39 #include "SkTraceEvent.h" | 40 #include "SkTraceEvent.h" |
40 | 41 |
(...skipping 1856 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1897 fResourceCache->purgeAsNeeded(1, resource->gpuMemorySize()); | 1898 fResourceCache->purgeAsNeeded(1, resource->gpuMemorySize()); |
1898 fResourceCache->addResource(resourceKey, resource); | 1899 fResourceCache->addResource(resourceKey, resource); |
1899 } | 1900 } |
1900 | 1901 |
1901 GrCacheable* GrContext::findAndRefCachedResource(const GrResourceKey& resourceKe
y) { | 1902 GrCacheable* GrContext::findAndRefCachedResource(const GrResourceKey& resourceKe
y) { |
1902 GrCacheable* resource = fResourceCache->find(resourceKey); | 1903 GrCacheable* resource = fResourceCache->find(resourceKey); |
1903 SkSafeRef(resource); | 1904 SkSafeRef(resource); |
1904 return resource; | 1905 return resource; |
1905 } | 1906 } |
1906 | 1907 |
| 1908 void GrContext::addGpuTraceMarker(const GrGpuTraceMarker* marker) { |
| 1909 fGpu->addGpuTraceMarker(marker); |
| 1910 if (NULL != fDrawBuffer) { |
| 1911 fDrawBuffer->addGpuTraceMarker(marker); |
| 1912 } |
| 1913 } |
| 1914 |
| 1915 void GrContext::removeGpuTraceMarker(const GrGpuTraceMarker* marker) { |
| 1916 fGpu->removeGpuTraceMarker(marker); |
| 1917 if (NULL != fDrawBuffer) { |
| 1918 fDrawBuffer->removeGpuTraceMarker(marker); |
| 1919 } |
| 1920 } |
| 1921 |
1907 /////////////////////////////////////////////////////////////////////////////// | 1922 /////////////////////////////////////////////////////////////////////////////// |
1908 #if GR_CACHE_STATS | 1923 #if GR_CACHE_STATS |
1909 void GrContext::printCacheStats() const { | 1924 void GrContext::printCacheStats() const { |
1910 fResourceCache->printStats(); | 1925 fResourceCache->printStats(); |
1911 } | 1926 } |
1912 #endif | 1927 #endif |
OLD | NEW |