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 | |
11 #include "GrBufferedDrawTarget.h" | |
10 #include "GrContextOptions.h" | 12 #include "GrContextOptions.h" |
11 #include "GrGpuResourceCacheAccess.h" | 13 #include "GrGpuResourceCacheAccess.h" |
12 #include "GrInOrderDrawBuffer.h" | |
13 #include "GrResourceCache.h" | 14 #include "GrResourceCache.h" |
14 #include "SkString.h" | 15 #include "SkString.h" |
15 | 16 |
16 void GrTestTarget::init(GrContext* ctx, GrDrawTarget* target) { | 17 void GrTestTarget::init(GrContext* ctx, GrDrawTarget* target) { |
17 SkASSERT(!fContext); | 18 SkASSERT(!fContext); |
18 | 19 |
19 fContext.reset(SkRef(ctx)); | 20 fContext.reset(SkRef(ctx)); |
20 fDrawTarget.reset(SkRef(target)); | 21 fDrawTarget.reset(SkRef(target)); |
21 } | 22 } |
22 | 23 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
128 #endif | 129 #endif |
129 | 130 |
130 /////////////////////////////////////////////////////////////////////////////// | 131 /////////////////////////////////////////////////////////////////////////////// |
131 | 132 |
132 void GrResourceCache::changeTimestamp(uint32_t newTimestamp) { fTimestamp = newT imestamp; } | 133 void GrResourceCache::changeTimestamp(uint32_t newTimestamp) { fTimestamp = newT imestamp; } |
133 | 134 |
134 /////////////////////////////////////////////////////////////////////////////// | 135 /////////////////////////////////////////////////////////////////////////////// |
135 // Code for the mock context. It's built on a mock GrGpu class that does nothing . | 136 // Code for the mock context. It's built on a mock GrGpu class that does nothing . |
136 //// | 137 //// |
137 | 138 |
138 #include "GrInOrderDrawBuffer.h" | |
139 #include "GrGpu.h" | 139 #include "GrGpu.h" |
140 | 140 |
robertphillips
2015/07/28 16:12:52
We include this twice ?
| |
141 #include "GrBufferedDrawTarget.h" | |
142 | |
141 class GrPipeline; | 143 class GrPipeline; |
142 | 144 |
143 class MockGpu : public GrGpu { | 145 class MockGpu : public GrGpu { |
144 public: | 146 public: |
145 MockGpu(GrContext* context, const GrContextOptions& options) : INHERITED(con text) { | 147 MockGpu(GrContext* context, const GrContextOptions& options) : INHERITED(con text) { |
146 fCaps.reset(SkNEW_ARGS(GrCaps, (options))); | 148 fCaps.reset(SkNEW_ARGS(GrCaps, (options))); |
147 } | 149 } |
148 ~MockGpu() override {} | 150 ~MockGpu() override {} |
149 bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig) const override { | 151 bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig) const override { |
150 return true; | 152 return true; |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
257 SkASSERT(NULL == fGpu); | 259 SkASSERT(NULL == fGpu); |
258 fGpu = SkNEW_ARGS(MockGpu, (this, options)); | 260 fGpu = SkNEW_ARGS(MockGpu, (this, options)); |
259 SkASSERT(fGpu); | 261 SkASSERT(fGpu); |
260 this->initCommon(); | 262 this->initCommon(); |
261 | 263 |
262 // 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 |
263 // 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 |
264 // resources in the buffer pools. | 266 // resources in the buffer pools. |
265 fDrawingMgr.abandon(); | 267 fDrawingMgr.abandon(); |
266 } | 268 } |
OLD | NEW |