| 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 | 10 |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 #endif | 124 #endif |
| 125 | 125 |
| 126 /////////////////////////////////////////////////////////////////////////////// | 126 /////////////////////////////////////////////////////////////////////////////// |
| 127 | 127 |
| 128 void GrResourceCache::changeTimestamp(uint32_t newTimestamp) { fTimestamp = newT
imestamp; } | 128 void GrResourceCache::changeTimestamp(uint32_t newTimestamp) { fTimestamp = newT
imestamp; } |
| 129 | 129 |
| 130 /////////////////////////////////////////////////////////////////////////////// | 130 /////////////////////////////////////////////////////////////////////////////// |
| 131 // Code for the mock context. It's built on a mock GrGpu class that does nothing
. | 131 // Code for the mock context. It's built on a mock GrGpu class that does nothing
. |
| 132 //// | 132 //// |
| 133 | 133 |
| 134 #include "GrBufferAllocPool.h" | |
| 135 #include "GrInOrderDrawBuffer.h" | 134 #include "GrInOrderDrawBuffer.h" |
| 136 #include "GrGpu.h" | 135 #include "GrGpu.h" |
| 137 | 136 |
| 138 class GrPipeline; | 137 class GrPipeline; |
| 139 | 138 |
| 140 class MockGpu : public GrGpu { | 139 class MockGpu : public GrGpu { |
| 141 public: | 140 public: |
| 142 MockGpu(GrContext* context) : INHERITED(context) { fCaps.reset(SkNEW(GrDrawT
argetCaps)); } | 141 MockGpu(GrContext* context) : INHERITED(context) { fCaps.reset(SkNEW(GrDrawT
argetCaps)); } |
| 143 ~MockGpu() override {} | 142 ~MockGpu() override {} |
| 144 bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig) const
override { | 143 bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig) const
override { |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 void GrContext::initMockContext() { | 258 void GrContext::initMockContext() { |
| 260 SkASSERT(NULL == fGpu); | 259 SkASSERT(NULL == fGpu); |
| 261 fGpu = SkNEW_ARGS(MockGpu, (this)); | 260 fGpu = SkNEW_ARGS(MockGpu, (this)); |
| 262 SkASSERT(fGpu); | 261 SkASSERT(fGpu); |
| 263 this->initCommon(); | 262 this->initCommon(); |
| 264 | 263 |
| 265 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 264 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
| 266 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 265 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
| 267 // resources in the buffer pools. | 266 // resources in the buffer pools. |
| 268 SkDELETE(fDrawBuffer); | 267 SkDELETE(fDrawBuffer); |
| 269 SkDELETE(fDrawBufferVBAllocPool); | 268 fDrawBuffer = NULL; |
| 270 SkDELETE(fDrawBufferIBAllocPool); | |
| 271 | 269 |
| 272 fDrawBuffer = NULL; | |
| 273 fDrawBufferVBAllocPool = NULL; | |
| 274 fDrawBufferIBAllocPool = NULL; | |
| 275 } | 270 } |
| OLD | NEW |