OLD | NEW |
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 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 const GrStencilSettings&); | 362 const GrStencilSettings&); |
363 | 363 |
364 /////////////////////////////////////////////////////////////////////////// | 364 /////////////////////////////////////////////////////////////////////////// |
365 // Debugging and Stats | 365 // Debugging and Stats |
366 | 366 |
367 class Stats { | 367 class Stats { |
368 public: | 368 public: |
369 #if GR_GPU_STATS | 369 #if GR_GPU_STATS |
370 Stats() { this->reset(); } | 370 Stats() { this->reset(); } |
371 | 371 |
372 void reset() { fRenderTargetBinds = 0; fShaderCompilations = 0; } | 372 void reset() { |
| 373 fRenderTargetBinds = 0; |
| 374 fShaderCompilations = 0; |
| 375 fTextureCreates = 0; |
| 376 fTextureUploads = 0; |
| 377 } |
373 | 378 |
374 int renderTargetBinds() const { return fRenderTargetBinds; } | 379 int renderTargetBinds() const { return fRenderTargetBinds; } |
375 void incRenderTargetBinds() { fRenderTargetBinds++; } | 380 void incRenderTargetBinds() { fRenderTargetBinds++; } |
376 int shaderCompilations() const { return fShaderCompilations; } | 381 int shaderCompilations() const { return fShaderCompilations; } |
377 void incShaderCompilations() { fShaderCompilations++; } | 382 void incShaderCompilations() { fShaderCompilations++; } |
| 383 int textureCreates() const { return fTextureCreates; } |
| 384 void incTextureCreates() { fTextureCreates++; } |
| 385 int textureUploads() const { return fTextureUploads; } |
| 386 void incTextureUploads() { fTextureUploads++; } |
378 void dump(SkString*); | 387 void dump(SkString*); |
379 | 388 |
380 private: | 389 private: |
381 int fRenderTargetBinds; | 390 int fRenderTargetBinds; |
382 int fShaderCompilations; | 391 int fShaderCompilations; |
| 392 int fTextureCreates; |
| 393 int fTextureUploads; |
383 #else | 394 #else |
384 void dump(SkString*) {}; | 395 void dump(SkString*) {}; |
385 void incRenderTargetBinds() {} | 396 void incRenderTargetBinds() {} |
386 void incShaderCompilations() {} | 397 void incShaderCompilations() {} |
| 398 void incTextureCreates() {} |
| 399 void incTextureUploads() {} |
387 #endif | 400 #endif |
388 }; | 401 }; |
389 | 402 |
390 Stats* stats() { return &fStats; } | 403 Stats* stats() { return &fStats; } |
391 | 404 |
392 /** | 405 /** |
393 * Called at start and end of gpu trace marking | 406 * Called at start and end of gpu trace marking |
394 * GR_CREATE_GPU_TRACE_MARKER(marker_str, target) will automatically call th
ese at the start | 407 * GR_CREATE_GPU_TRACE_MARKER(marker_str, target) will automatically call th
ese at the start |
395 * and end of a code block respectively | 408 * and end of a code block respectively |
396 */ | 409 */ |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
519 int fGpuTrac
eMarkerCount; | 532 int fGpuTrac
eMarkerCount; |
520 GrTraceMarkerSet fActiveT
raceMarkers; | 533 GrTraceMarkerSet fActiveT
raceMarkers; |
521 GrTraceMarkerSet fStoredT
raceMarkers; | 534 GrTraceMarkerSet fStoredT
raceMarkers; |
522 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 535 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
523 GrContext* fContext
; | 536 GrContext* fContext
; |
524 | 537 |
525 typedef SkRefCnt INHERITED; | 538 typedef SkRefCnt INHERITED; |
526 }; | 539 }; |
527 | 540 |
528 #endif | 541 #endif |
OLD | NEW |