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

Side by Side Diff: src/gpu/GrGpu.h

Issue 1433353005: Fix leaks in unit tests of GrGLTextureInfos (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 1 month 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 | « no previous file | src/gpu/GrTest.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 * Copyright 2011 Google Inc. 2 * Copyright 2011 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 #ifndef GrGpu_DEFINED 8 #ifndef GrGpu_DEFINED
9 #define GrGpu_DEFINED 9 #define GrGpu_DEFINED
10 10
(...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 void incShaderCompilations() {} 356 void incShaderCompilations() {}
357 void incTextureCreates() {} 357 void incTextureCreates() {}
358 void incTextureUploads() {} 358 void incTextureUploads() {}
359 void incStencilAttachmentCreates() {} 359 void incStencilAttachmentCreates() {}
360 void incNumDraws() {} 360 void incNumDraws() {}
361 #endif 361 #endif
362 }; 362 };
363 363
364 Stats* stats() { return &fStats; } 364 Stats* stats() { return &fStats; }
365 365
366 // creation and deletion of raw texture for testing 366 /** Creates a texture directly in the backend API without wrapping it in a G rTexture. This is
367 // only to be used in GPU-specific tests 367 only to be used for testing (particularly for testing the methods that i mport an externally
368 created texture into Skia. Must be matched with a call to deleteTestingO nlyTexture(). */
368 virtual GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, 369 virtual GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h,
369 GrPixelConfig config ) const = 0; 370 GrPixelConfig config ) const = 0;
370 virtual bool isTestingOnlyBackendTexture(GrBackendObject id) const = 0; 371 /** Check a handle represents an actual texture in the backend API that has not been freed. */
371 virtual void deleteTestingOnlyBackendTexture(GrBackendObject id) const = 0; 372 virtual bool isTestingOnlyBackendTexture(GrBackendObject) const = 0;
373 /** If ownership of the backend texture has been transferred pass true for a bandonTexture. This
374 will do any necessary cleanup of the handle without freeing the texture in the backend
375 API. */
376 virtual void deleteTestingOnlyBackendTexture(GrBackendObject,
377 bool abandonTexture = false) co nst = 0;
372 378
373 // width and height may be larger than rt (if underlying API allows it). 379 // width and height may be larger than rt (if underlying API allows it).
374 // Returns nullptr if compatible sb could not be created, otherwise the call er owns the ref on 380 // Returns nullptr if compatible sb could not be created, otherwise the call er owns the ref on
375 // the GrStencilAttachment. 381 // the GrStencilAttachment.
376 virtual GrStencilAttachment* createStencilAttachmentForRenderTarget(const Gr RenderTarget*, 382 virtual GrStencilAttachment* createStencilAttachmentForRenderTarget(const Gr RenderTarget*,
377 int widt h, 383 int widt h,
378 int heig ht) = 0; 384 int heig ht) = 0;
379 // clears target's entire stencil buffer to 0 385 // clears target's entire stencil buffer to 0
380 virtual void clearStencil(GrRenderTarget* target) = 0; 386 virtual void clearStencil(GrRenderTarget* target) = 0;
381 387
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 ResetTimestamp fResetTi mestamp; 501 ResetTimestamp fResetTi mestamp;
496 uint32_t fResetBi ts; 502 uint32_t fResetBi ts;
497 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. 503 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu.
498 GrContext* fContext ; 504 GrContext* fContext ;
499 505
500 friend class GrPathRendering; 506 friend class GrPathRendering;
501 typedef SkRefCnt INHERITED; 507 typedef SkRefCnt INHERITED;
502 }; 508 };
503 509
504 #endif 510 #endif
OLDNEW
« no previous file with comments | « no previous file | src/gpu/GrTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698