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

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

Issue 1333543002: Add number of draws to GrGpu stats (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « 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 313 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 public: 324 public:
325 #if GR_GPU_STATS 325 #if GR_GPU_STATS
326 Stats() { this->reset(); } 326 Stats() { this->reset(); }
327 327
328 void reset() { 328 void reset() {
329 fRenderTargetBinds = 0; 329 fRenderTargetBinds = 0;
330 fShaderCompilations = 0; 330 fShaderCompilations = 0;
331 fTextureCreates = 0; 331 fTextureCreates = 0;
332 fTextureUploads = 0; 332 fTextureUploads = 0;
333 fStencilAttachmentCreates = 0; 333 fStencilAttachmentCreates = 0;
334 fNumDraws = 0;
334 } 335 }
335 336
336 int renderTargetBinds() const { return fRenderTargetBinds; } 337 int renderTargetBinds() const { return fRenderTargetBinds; }
337 void incRenderTargetBinds() { fRenderTargetBinds++; } 338 void incRenderTargetBinds() { fRenderTargetBinds++; }
338 int shaderCompilations() const { return fShaderCompilations; } 339 int shaderCompilations() const { return fShaderCompilations; }
339 void incShaderCompilations() { fShaderCompilations++; } 340 void incShaderCompilations() { fShaderCompilations++; }
340 int textureCreates() const { return fTextureCreates; } 341 int textureCreates() const { return fTextureCreates; }
341 void incTextureCreates() { fTextureCreates++; } 342 void incTextureCreates() { fTextureCreates++; }
342 int textureUploads() const { return fTextureUploads; } 343 int textureUploads() const { return fTextureUploads; }
343 void incTextureUploads() { fTextureUploads++; } 344 void incTextureUploads() { fTextureUploads++; }
344 void incStencilAttachmentCreates() { fStencilAttachmentCreates++; } 345 void incStencilAttachmentCreates() { fStencilAttachmentCreates++; }
346 void incNumDraws() { fNumDraws++; }
345 void dump(SkString*); 347 void dump(SkString*);
346 348
347 private: 349 private:
348 int fRenderTargetBinds; 350 int fRenderTargetBinds;
349 int fShaderCompilations; 351 int fShaderCompilations;
350 int fTextureCreates; 352 int fTextureCreates;
351 int fTextureUploads; 353 int fTextureUploads;
352 int fStencilAttachmentCreates; 354 int fStencilAttachmentCreates;
355 int fNumDraws;
353 #else 356 #else
354 void dump(SkString*) {}; 357 void dump(SkString*) {};
355 void incRenderTargetBinds() {} 358 void incRenderTargetBinds() {}
356 void incShaderCompilations() {} 359 void incShaderCompilations() {}
357 void incTextureCreates() {} 360 void incTextureCreates() {}
358 void incTextureUploads() {} 361 void incTextureUploads() {}
359 void incStencilAttachmentCreates() {} 362 void incStencilAttachmentCreates() {}
363 void incNumDraws() {}
360 #endif 364 #endif
361 }; 365 };
362 366
363 Stats* stats() { return &fStats; } 367 Stats* stats() { return &fStats; }
364 368
365 // creation and deletion of raw texture for testing 369 // creation and deletion of raw texture for testing
366 // only to be used in GPU-specific tests 370 // only to be used in GPU-specific tests
367 virtual GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h, 371 virtual GrBackendObject createTestingOnlyBackendTexture(void* pixels, int w, int h,
368 GrPixelConfig config ) const = 0; 372 GrPixelConfig config ) const = 0;
369 virtual bool isTestingOnlyBackendTexture(GrBackendObject id) const = 0; 373 virtual bool isTestingOnlyBackendTexture(GrBackendObject id) const = 0;
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 ResetTimestamp fResetTi mestamp; 496 ResetTimestamp fResetTi mestamp;
493 uint32_t fResetBi ts; 497 uint32_t fResetBi ts;
494 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. 498 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu.
495 GrContext* fContext ; 499 GrContext* fContext ;
496 500
497 friend class GrPathRendering; 501 friend class GrPathRendering;
498 typedef SkRefCnt INHERITED; 502 typedef SkRefCnt INHERITED;
499 }; 503 };
500 504
501 #endif 505 #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