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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // Code for the mock context. It's built on a mock GrGpu class that does nothing
. | 131 // Code for the mock context. It's built on a mock GrGpu class that does nothing
. |
132 //// | 132 //// |
133 | 133 |
134 #include "GrInOrderDrawBuffer.h" | 134 #include "GrInOrderDrawBuffer.h" |
135 #include "GrGpu.h" | 135 #include "GrGpu.h" |
136 | 136 |
137 class GrPipeline; | 137 class GrPipeline; |
138 | 138 |
139 class MockGpu : public GrGpu { | 139 class MockGpu : public GrGpu { |
140 public: | 140 public: |
141 MockGpu(GrContext* context) : INHERITED(context) { fCaps.reset(SkNEW(GrDrawT
argetCaps)); } | 141 MockGpu(GrContext* context) : INHERITED(context) { fCaps.reset(SkNEW(GrCaps)
); } |
142 ~MockGpu() override {} | 142 ~MockGpu() override {} |
143 bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig) const
override { | 143 bool canWriteTexturePixels(const GrTexture*, GrPixelConfig srcConfig) const
override { |
144 return true; | 144 return true; |
145 } | 145 } |
146 | 146 |
147 bool readPixelsWillPayForYFlip(GrRenderTarget* renderTarget, | 147 bool readPixelsWillPayForYFlip(GrRenderTarget* renderTarget, |
148 int left, int top, | 148 int left, int top, |
149 int width, int height, | 149 int width, int height, |
150 GrPixelConfig config, | 150 GrPixelConfig config, |
151 size_t rowBytes) const override { return fals
e; } | 151 size_t rowBytes) const override { return fals
e; } |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 SkASSERT(fGpu); | 261 SkASSERT(fGpu); |
262 this->initCommon(); | 262 this->initCommon(); |
263 | 263 |
264 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of | 264 // We delete these because we want to test the cache starting with zero reso
urces. Also, none of |
265 // these objects are required for any of tests that use this context. TODO:
make stop allocating | 265 // these objects are required for any of tests that use this context. TODO:
make stop allocating |
266 // resources in the buffer pools. | 266 // resources in the buffer pools. |
267 SkDELETE(fDrawBuffer); | 267 SkDELETE(fDrawBuffer); |
268 fDrawBuffer = NULL; | 268 fDrawBuffer = NULL; |
269 | 269 |
270 } | 270 } |
OLD | NEW |