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 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 | 254 |
255 #define ASSERT_SINGLE_OWNER \ | 255 #define ASSERT_SINGLE_OWNER \ |
256 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fSingleOwner);) | 256 SkDEBUGCODE(GrSingleOwner::AutoEnforce debug_SingleOwner(fSingleOwner);) |
257 #define RETURN_IF_ABANDONED if (fDrawingManager->abandoned()) { return; } | 257 #define RETURN_IF_ABANDONED if (fDrawingManager->abandoned()) { return; } |
258 | 258 |
259 void GrDrawContext::internal_drawBatch(const GrPipelineBuilder& pipelineBuilder, | 259 void GrDrawContext::internal_drawBatch(const GrPipelineBuilder& pipelineBuilder, |
260 GrDrawBatch* batch) { | 260 GrDrawBatch* batch) { |
261 ASSERT_SINGLE_OWNER | 261 ASSERT_SINGLE_OWNER |
262 RETURN_IF_ABANDONED | 262 RETURN_IF_ABANDONED |
263 SkDEBUGCODE(this->validate();) | 263 SkDEBUGCODE(this->validate();) |
| 264 GR_AUDIT_TRAIL_AUTO_FRAME(fAuditTrail, "GrDrawContext::internal_drawBatch"); |
264 | 265 |
265 this->getDrawTarget()->drawBatch(pipelineBuilder, batch); | 266 this->getDrawTarget()->drawBatch(pipelineBuilder, batch); |
266 } | 267 } |
267 | 268 |
268 #undef ASSERT_SINGLE_OWNER | 269 #undef ASSERT_SINGLE_OWNER |
269 #undef RETURN_IF_ABANDONED | 270 #undef RETURN_IF_ABANDONED |
270 | 271 |
271 /////////////////////////////////////////////////////////////////////////////// | 272 /////////////////////////////////////////////////////////////////////////////// |
272 // Code for the mock context. It's built on a mock GrGpu class that does nothing
. | 273 // Code for the mock context. It's built on a mock GrGpu class that does nothing
. |
273 //// | 274 //// |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
406 SkASSERT(nullptr == fGpu); | 407 SkASSERT(nullptr == fGpu); |
407 fGpu = new MockGpu(this, options); | 408 fGpu = new MockGpu(this, options); |
408 SkASSERT(fGpu); | 409 SkASSERT(fGpu); |
409 this->initCommon(options); | 410 this->initCommon(options); |
410 | 411 |
411 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 412 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
412 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 413 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
413 // resources in the buffer pools. | 414 // resources in the buffer pools. |
414 fDrawingManager->abandon(); | 415 fDrawingManager->abandon(); |
415 } | 416 } |
OLD | NEW |