| OLD | NEW |
| 1 | 1 |
| 2 /* | 2 /* |
| 3 * Copyright 2013 Google Inc. | 3 * Copyright 2013 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 #include "GrTest.h" | 9 #include "GrTest.h" |
| 10 #include "GrContextOptions.h" | 10 #include "GrContextOptions.h" |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 232 |
| 233 GrContext* GrContext::CreateMockContext() { | 233 GrContext* GrContext::CreateMockContext() { |
| 234 GrContext* context = SkNEW(GrContext); | 234 GrContext* context = SkNEW(GrContext); |
| 235 | 235 |
| 236 context->initMockContext(); | 236 context->initMockContext(); |
| 237 return context; | 237 return context; |
| 238 } | 238 } |
| 239 | 239 |
| 240 void GrContext::initMockContext() { | 240 void GrContext::initMockContext() { |
| 241 GrContextOptions options; | 241 GrContextOptions options; |
| 242 options.fGeometryBufferMapThreshold = 0; |
| 242 SkASSERT(NULL == fGpu); | 243 SkASSERT(NULL == fGpu); |
| 243 fGpu = SkNEW_ARGS(MockGpu, (this, options)); | 244 fGpu = SkNEW_ARGS(MockGpu, (this, options)); |
| 244 SkASSERT(fGpu); | 245 SkASSERT(fGpu); |
| 245 this->initCommon(); | 246 this->initCommon(); |
| 246 | 247 |
| 247 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 248 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
| 248 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 249 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
| 249 // resources in the buffer pools. | 250 // resources in the buffer pools. |
| 250 fDrawingMgr.abandon(); | 251 fDrawingMgr.abandon(); |
| 251 } | 252 } |
| OLD | NEW |