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

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

Issue 1316123003: Style Change: SkNEW->new; SkDELETE->delete (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2015-08-26 (Wednesday) 15:59:00 EDT Created 5 years, 3 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
« no previous file with comments | « src/gpu/GrTessellatingPathRenderer.cpp ('k') | src/gpu/GrTestUtils.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 161 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 // Code for the mock context. It's built on a mock GrGpu class that does nothing . 172 // Code for the mock context. It's built on a mock GrGpu class that does nothing .
173 //// 173 ////
174 174
175 #include "GrGpu.h" 175 #include "GrGpu.h"
176 176
177 class GrPipeline; 177 class GrPipeline;
178 178
179 class MockGpu : public GrGpu { 179 class MockGpu : public GrGpu {
180 public: 180 public:
181 MockGpu(GrContext* context, const GrContextOptions& options) : INHERITED(con text) { 181 MockGpu(GrContext* context, const GrContextOptions& options) : INHERITED(con text) {
182 fCaps.reset(SkNEW_ARGS(GrCaps, (options))); 182 fCaps.reset(new GrCaps(options));
183 } 183 }
184 ~MockGpu() override {} 184 ~MockGpu() override {}
185 185
186 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh t, size_t rowBytes, 186 bool onGetReadPixelsInfo(GrSurface* srcSurface, int readWidth, int readHeigh t, size_t rowBytes,
187 GrPixelConfig readConfig, DrawPreference*, 187 GrPixelConfig readConfig, DrawPreference*,
188 ReadPixelTempDrawInfo*) override { return false; } 188 ReadPixelTempDrawInfo*) override { return false; }
189 189
190 bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, size _t rowBytes, 190 bool onGetWritePixelsInfo(GrSurface* dstSurface, int width, int height, size _t rowBytes,
191 GrPixelConfig srcConfig, DrawPreference*, 191 GrPixelConfig srcConfig, DrawPreference*,
192 WritePixelTempDrawInfo*) override { return false; } 192 WritePixelTempDrawInfo*) override { return false; }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 GrPixelConfig config) const override { 274 GrPixelConfig config) const override {
275 return 0; 275 return 0;
276 } 276 }
277 bool isTestingOnlyBackendTexture(GrBackendObject id) const override { return false; } 277 bool isTestingOnlyBackendTexture(GrBackendObject id) const override { return false; }
278 void deleteTestingOnlyBackendTexture(GrBackendObject id) const override {} 278 void deleteTestingOnlyBackendTexture(GrBackendObject id) const override {}
279 279
280 typedef GrGpu INHERITED; 280 typedef GrGpu INHERITED;
281 }; 281 };
282 282
283 GrContext* GrContext::CreateMockContext() { 283 GrContext* GrContext::CreateMockContext() {
284 GrContext* context = SkNEW(GrContext); 284 GrContext* context = new GrContext;
285 285
286 context->initMockContext(); 286 context->initMockContext();
287 return context; 287 return context;
288 } 288 }
289 289
290 void GrContext::initMockContext() { 290 void GrContext::initMockContext() {
291 GrContextOptions options; 291 GrContextOptions options;
292 options.fGeometryBufferMapThreshold = 0; 292 options.fGeometryBufferMapThreshold = 0;
293 SkASSERT(NULL == fGpu); 293 SkASSERT(NULL == fGpu);
294 fGpu = SkNEW_ARGS(MockGpu, (this, options)); 294 fGpu = new MockGpu(this, options);
295 SkASSERT(fGpu); 295 SkASSERT(fGpu);
296 this->initCommon(); 296 this->initCommon();
297 297
298 // We delete these because we want to test the cache starting with zero reso urces. Also, none of 298 // We delete these because we want to test the cache starting with zero reso urces. Also, none of
299 // these objects are required for any of tests that use this context. TODO: make stop allocating 299 // these objects are required for any of tests that use this context. TODO: make stop allocating
300 // resources in the buffer pools. 300 // resources in the buffer pools.
301 fDrawingMgr.abandon(); 301 fDrawingMgr.abandon();
302 } 302 }
OLDNEW
« no previous file with comments | « src/gpu/GrTessellatingPathRenderer.cpp ('k') | src/gpu/GrTestUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698