| 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" |
| 11 #include "GrContextOptions.h" | 11 #include "GrContextOptions.h" |
| 12 #include "GrDrawContextPriv.h" | 12 #include "GrDrawContextPriv.h" |
| 13 #include "GrDrawingManager.h" | 13 #include "GrDrawingManager.h" |
| 14 #include "GrGpuResourceCacheAccess.h" | 14 #include "GrGpuResourceCacheAccess.h" |
| 15 #include "GrPipelineBuilder.h" | 15 #include "GrPipelineBuilder.h" |
| 16 #include "GrRenderTargetProxy.h" |
| 16 #include "GrResourceCache.h" | 17 #include "GrResourceCache.h" |
| 17 | 18 |
| 18 #include "SkGpuDevice.h" | 19 #include "SkGpuDevice.h" |
| 19 #include "SkGrPriv.h" | 20 #include "SkGrPriv.h" |
| 20 #include "SkMathPriv.h" | 21 #include "SkMathPriv.h" |
| 21 #include "SkString.h" | 22 #include "SkString.h" |
| 22 | 23 |
| 23 #include "text/GrBatchFontCache.h" | 24 #include "text/GrBatchFontCache.h" |
| 24 #include "text/GrTextBlobCache.h" | 25 #include "text/GrTextBlobCache.h" |
| 25 | 26 |
| (...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 pipelineBuilder.setState(GrPipelineBuilder::kSnapVerticesToPixelCenters_
Flag, true); | 252 pipelineBuilder.setState(GrPipelineBuilder::kSnapVerticesToPixelCenters_
Flag, true); |
| 252 } | 253 } |
| 253 | 254 |
| 254 fDrawContext->getDrawTarget()->drawBatch(pipelineBuilder, fDrawContext, GrNo
Clip(), batch); | 255 fDrawContext->getDrawTarget()->drawBatch(pipelineBuilder, fDrawContext, GrNo
Clip(), batch); |
| 255 } | 256 } |
| 256 | 257 |
| 257 #undef ASSERT_SINGLE_OWNER | 258 #undef ASSERT_SINGLE_OWNER |
| 258 #undef RETURN_IF_ABANDONED | 259 #undef RETURN_IF_ABANDONED |
| 259 | 260 |
| 260 /////////////////////////////////////////////////////////////////////////////// | 261 /////////////////////////////////////////////////////////////////////////////// |
| 262 |
| 263 GrRenderTargetPriv::Flags GrRenderTargetProxy::testingOnly_getFlags() const { |
| 264 return fFlags; |
| 265 } |
| 266 |
| 267 /////////////////////////////////////////////////////////////////////////////// |
| 261 // Code for the mock context. It's built on a mock GrGpu class that does nothing
. | 268 // Code for the mock context. It's built on a mock GrGpu class that does nothing
. |
| 262 //// | 269 //// |
| 263 | 270 |
| 264 #include "GrGpu.h" | 271 #include "GrGpu.h" |
| 265 | 272 |
| 266 class GrPipeline; | 273 class GrPipeline; |
| 267 | 274 |
| 268 class MockCaps : public GrCaps { | 275 class MockCaps : public GrCaps { |
| 269 public: | 276 public: |
| 270 explicit MockCaps(const GrContextOptions& options) : INHERITED(options) {} | 277 explicit MockCaps(const GrContextOptions& options) : INHERITED(options) {} |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 SkASSERT(nullptr == fGpu); | 405 SkASSERT(nullptr == fGpu); |
| 399 fGpu = new MockGpu(this, options); | 406 fGpu = new MockGpu(this, options); |
| 400 SkASSERT(fGpu); | 407 SkASSERT(fGpu); |
| 401 this->initCommon(options); | 408 this->initCommon(options); |
| 402 | 409 |
| 403 // 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 |
| 404 // 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 |
| 405 // resources in the buffer pools. | 412 // resources in the buffer pools. |
| 406 fDrawingManager->abandon(); | 413 fDrawingManager->abandon(); |
| 407 } | 414 } |
| OLD | NEW |