OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "GrTest.h" | 8 #include "GrTest.h" |
9 | 9 |
10 #include "GrBatchAtlas.h" | 10 #include "GrBatchAtlas.h" |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 | 246 |
247 void GrResourceCache::changeTimestamp(uint32_t newTimestamp) { fTimestamp = newT
imestamp; } | 247 void GrResourceCache::changeTimestamp(uint32_t newTimestamp) { fTimestamp = newT
imestamp; } |
248 | 248 |
249 /////////////////////////////////////////////////////////////////////////////// | 249 /////////////////////////////////////////////////////////////////////////////// |
250 | 250 |
251 #define ASSERT_SINGLE_OWNER \ | 251 #define ASSERT_SINGLE_OWNER \ |
252 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fDrawContext->fSing
leOwner);) | 252 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fDrawContext->fSing
leOwner);) |
253 #define RETURN_IF_ABANDONED if (fDrawContext->fDrawingManager->abandoned(
)) { return; } | 253 #define RETURN_IF_ABANDONED if (fDrawContext->fDrawingManager->abandoned(
)) { return; } |
254 | 254 |
255 void GrDrawContextPriv::testingOnly_drawBatch(const GrPipelineBuilder& pipelineB
uilder, | 255 void GrDrawContextPriv::testingOnly_drawBatch(const GrPipelineBuilder& pipelineB
uilder, |
256 GrDrawBatch* batch) { | 256 GrDrawBatch* batch, |
| 257 const GrClip* clip) { |
257 ASSERT_SINGLE_OWNER | 258 ASSERT_SINGLE_OWNER |
258 RETURN_IF_ABANDONED | 259 RETURN_IF_ABANDONED |
259 SkDEBUGCODE(fDrawContext->validate();) | 260 SkDEBUGCODE(fDrawContext->validate();) |
260 GR_AUDIT_TRAIL_AUTO_FRAME(fDrawContext->fAuditTrail, "GrDrawContext::testing
Only_drawBatch"); | 261 GR_AUDIT_TRAIL_AUTO_FRAME(fDrawContext->fAuditTrail, "GrDrawContext::testing
Only_drawBatch"); |
261 | 262 |
262 fDrawContext->getDrawTarget()->drawBatch(pipelineBuilder, batch); | 263 const GrClip& drawClip = clip ? *clip : GrClip::WideOpen(); |
| 264 fDrawContext->getDrawTarget()->drawBatch(pipelineBuilder, drawClip, batch); |
263 } | 265 } |
264 | 266 |
265 #undef ASSERT_SINGLE_OWNER | 267 #undef ASSERT_SINGLE_OWNER |
266 #undef RETURN_IF_ABANDONED | 268 #undef RETURN_IF_ABANDONED |
267 | 269 |
268 /////////////////////////////////////////////////////////////////////////////// | 270 /////////////////////////////////////////////////////////////////////////////// |
269 // Code for the mock context. It's built on a mock GrGpu class that does nothing
. | 271 // Code for the mock context. It's built on a mock GrGpu class that does nothing
. |
270 //// | 272 //// |
271 | 273 |
272 #include "GrGpu.h" | 274 #include "GrGpu.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 SkASSERT(nullptr == fGpu); | 413 SkASSERT(nullptr == fGpu); |
412 fGpu = new MockGpu(this, options); | 414 fGpu = new MockGpu(this, options); |
413 SkASSERT(fGpu); | 415 SkASSERT(fGpu); |
414 this->initCommon(options); | 416 this->initCommon(options); |
415 | 417 |
416 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 418 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
417 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 419 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
418 // resources in the buffer pools. | 420 // resources in the buffer pools. |
419 fDrawingManager->abandon(); | 421 fDrawingManager->abandon(); |
420 } | 422 } |
OLD | NEW |