Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Side by Side Diff: src/gpu/GrTest.cpp

Issue 1574383002: Hide drawBatch on GrDrawTarget from test Methods (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rename internal Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(GrPipelineBuilder* pipelineBuilder, GrDra wBatch* batch) {
260 ASSERT_SINGLE_OWNER
261 RETURN_IF_ABANDONED
262 SkDEBUGCODE(this->validate();)
robertphillips 2016/01/12 20:56:33 I think we still want to get a test target in here
263
264 this->getDrawTarget()->drawBatch(*pipelineBuilder, batch);
265 }
266
267 #undef ASSERT_SINGLE_OWNER
268 #undef RETURN_IF_ABANDONED
269
270 ///////////////////////////////////////////////////////////////////////////////
254 // 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 .
255 //// 272 ////
256 273
257 #include "GrGpu.h" 274 #include "GrGpu.h"
258 275
259 class GrPipeline; 276 class GrPipeline;
260 277
261 class MockCaps : public GrCaps { 278 class MockCaps : public GrCaps {
262 public: 279 public:
263 explicit MockCaps(const GrContextOptions& options) : INHERITED(options) {} 280 explicit MockCaps(const GrContextOptions& options) : INHERITED(options) {}
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 SkASSERT(nullptr == fGpu); 405 SkASSERT(nullptr == fGpu);
389 fGpu = new MockGpu(this, options); 406 fGpu = new MockGpu(this, options);
390 SkASSERT(fGpu); 407 SkASSERT(fGpu);
391 this->initCommon(options); 408 this->initCommon(options);
392 409
393 // We delete these because we want to test the cache starting with zero reso urces. Also, none of 410 // 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 411 // these objects are required for any of tests that use this context. TODO: make stop allocating
395 // resources in the buffer pools. 412 // resources in the buffer pools.
396 fDrawingManager->abandon(); 413 fDrawingManager->abandon();
397 } 414 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698