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 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
244 keys->push_back(SkString("gpu_cache_unbudgeted_size")); values->push_back((d
ouble)stats.fUnbudgetedSize); | 244 keys->push_back(SkString("gpu_cache_unbudgeted_size")); values->push_back((d
ouble)stats.fUnbudgetedSize); |
245 } | 245 } |
246 | 246 |
247 #endif | 247 #endif |
248 | 248 |
249 /////////////////////////////////////////////////////////////////////////////// | 249 /////////////////////////////////////////////////////////////////////////////// |
250 | 250 |
251 void GrResourceCache::changeTimestamp(uint32_t newTimestamp) { fTimestamp = newT
imestamp; } | 251 void GrResourceCache::changeTimestamp(uint32_t newTimestamp) { fTimestamp = newT
imestamp; } |
252 | 252 |
253 /////////////////////////////////////////////////////////////////////////////// | 253 /////////////////////////////////////////////////////////////////////////////// |
| 254 |
| 255 #define ASSERT_SINGLE_OWNER \ |
| 256 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fSingleOwner);) |
| 257 #define RETURN_IF_ABANDONED if (fDrawingManager->abandoned()) { return; } |
| 258 |
| 259 void GrDrawContext::internal_drawBatch(const GrPipelineBuilder& pipelineBuilder, |
| 260 GrDrawBatch* batch) { |
| 261 ASSERT_SINGLE_OWNER |
| 262 RETURN_IF_ABANDONED |
| 263 SkDEBUGCODE(this->validate();) |
| 264 |
| 265 this->getDrawTarget()->drawBatch(pipelineBuilder, batch); |
| 266 } |
| 267 |
| 268 #undef ASSERT_SINGLE_OWNER |
| 269 #undef RETURN_IF_ABANDONED |
| 270 |
| 271 /////////////////////////////////////////////////////////////////////////////// |
254 // Code for the mock context. It's built on a mock GrGpu class that does nothing
. | 272 // Code for the mock context. It's built on a mock GrGpu class that does nothing
. |
255 //// | 273 //// |
256 | 274 |
257 #include "GrGpu.h" | 275 #include "GrGpu.h" |
258 | 276 |
259 class GrPipeline; | 277 class GrPipeline; |
260 | 278 |
261 class MockCaps : public GrCaps { | 279 class MockCaps : public GrCaps { |
262 public: | 280 public: |
263 explicit MockCaps(const GrContextOptions& options) : INHERITED(options) {} | 281 explicit MockCaps(const GrContextOptions& options) : INHERITED(options) {} |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 SkASSERT(nullptr == fGpu); | 406 SkASSERT(nullptr == fGpu); |
389 fGpu = new MockGpu(this, options); | 407 fGpu = new MockGpu(this, options); |
390 SkASSERT(fGpu); | 408 SkASSERT(fGpu); |
391 this->initCommon(options); | 409 this->initCommon(options); |
392 | 410 |
393 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 411 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
394 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 412 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
395 // resources in the buffer pools. | 413 // resources in the buffer pools. |
396 fDrawingManager->abandon(); | 414 fDrawingManager->abandon(); |
397 } | 415 } |
OLD | NEW |