Chromium Code Reviews| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 103 fResourceCache = NULL; | 103 fResourceCache = NULL; |
| 104 fFontCache = NULL; | 104 fFontCache = NULL; |
| 105 fDrawBuffer = NULL; | 105 fDrawBuffer = NULL; |
| 106 fDrawBufferVBAllocPool = NULL; | 106 fDrawBufferVBAllocPool = NULL; |
| 107 fDrawBufferIBAllocPool = NULL; | 107 fDrawBufferIBAllocPool = NULL; |
| 108 fFlushToReduceCacheSize = false; | 108 fFlushToReduceCacheSize = false; |
| 109 fAARectRenderer = NULL; | 109 fAARectRenderer = NULL; |
| 110 fOvalRenderer = NULL; | 110 fOvalRenderer = NULL; |
| 111 fViewMatrix.reset(); | 111 fViewMatrix.reset(); |
| 112 fMaxTextureSizeOverride = 1 << 20; | 112 fMaxTextureSizeOverride = 1 << 20; |
| 113 fGpuTracingEnabled = false; | 113 |
| 114 // Check if the gpu.serivce category is set from tracing and enable GpuTraci ng if it is | |
|
bsalomon
2014/08/04 15:22:05
Is it really right to do this only when the GrCont
| |
| 115 const unsigned char *category_enabled = TRACE_EVENT_API_GET_CATEGORY_GROUP_E NABLED( | |
| 116 TRACE_DISABLED_BY_DEFAULT("gpu.service")); | |
| 117 if (*category_enabled != 0) { | |
| 118 fGpuTracingEnabled = true; | |
| 119 } else { | |
| 120 fGpuTracingEnabled = false; | |
| 121 } | |
| 114 } | 122 } |
| 115 | 123 |
| 116 bool GrContext::init(GrBackend backend, GrBackendContext backendContext) { | 124 bool GrContext::init(GrBackend backend, GrBackendContext backendContext) { |
| 117 SkASSERT(NULL == fGpu); | 125 SkASSERT(NULL == fGpu); |
| 118 | 126 |
| 119 fGpu = GrGpu::Create(backend, backendContext, this); | 127 fGpu = GrGpu::Create(backend, backendContext, this); |
| 120 if (NULL == fGpu) { | 128 if (NULL == fGpu) { |
| 121 return false; | 129 return false; |
| 122 } | 130 } |
| 123 | 131 |
| (...skipping 1796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1920 fDrawBuffer->removeGpuTraceMarker(marker); | 1928 fDrawBuffer->removeGpuTraceMarker(marker); |
| 1921 } | 1929 } |
| 1922 } | 1930 } |
| 1923 | 1931 |
| 1924 /////////////////////////////////////////////////////////////////////////////// | 1932 /////////////////////////////////////////////////////////////////////////////// |
| 1925 #if GR_CACHE_STATS | 1933 #if GR_CACHE_STATS |
| 1926 void GrContext::printCacheStats() const { | 1934 void GrContext::printCacheStats() const { |
| 1927 fResourceCache->printStats(); | 1935 fResourceCache->printStats(); |
| 1928 } | 1936 } |
| 1929 #endif | 1937 #endif |
| OLD | NEW |