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 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 | 280 |
281 #include "GrGpu.h" | 281 #include "GrGpu.h" |
282 | 282 |
283 class GrPipeline; | 283 class GrPipeline; |
284 | 284 |
285 class MockCaps : public GrCaps { | 285 class MockCaps : public GrCaps { |
286 public: | 286 public: |
287 explicit MockCaps(const GrContextOptions& options) : INHERITED(options) {} | 287 explicit MockCaps(const GrContextOptions& options) : INHERITED(options) {} |
288 bool isConfigTexturable(GrPixelConfig config) const override { return false;
} | 288 bool isConfigTexturable(GrPixelConfig config) const override { return false;
} |
289 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const override
{ return false; } | 289 bool isConfigRenderable(GrPixelConfig config, bool withMSAA) const override
{ return false; } |
| 290 bool isConfigTexSupportEnabled(GrPixelConfig config) const override { return
false; } |
290 private: | 291 private: |
291 typedef GrCaps INHERITED; | 292 typedef GrCaps INHERITED; |
292 }; | 293 }; |
293 | 294 |
294 class MockGpu : public GrGpu { | 295 class MockGpu : public GrGpu { |
295 public: | 296 public: |
296 MockGpu(GrContext* context, const GrContextOptions& options) : INHERITED(con
text) { | 297 MockGpu(GrContext* context, const GrContextOptions& options) : INHERITED(con
text) { |
297 fCaps.reset(new MockCaps(options)); | 298 fCaps.reset(new MockCaps(options)); |
298 } | 299 } |
299 ~MockGpu() override {} | 300 ~MockGpu() override {} |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
416 SkASSERT(nullptr == fGpu); | 417 SkASSERT(nullptr == fGpu); |
417 fGpu = new MockGpu(this, options); | 418 fGpu = new MockGpu(this, options); |
418 SkASSERT(fGpu); | 419 SkASSERT(fGpu); |
419 this->initCommon(options); | 420 this->initCommon(options); |
420 | 421 |
421 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 422 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
422 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 423 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
423 // resources in the buffer pools. | 424 // resources in the buffer pools. |
424 fDrawingManager->abandon(); | 425 fDrawingManager->abandon(); |
425 } | 426 } |
OLD | NEW |