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 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 * Takes the current active set of markers and stores them for later use. An
y current marker | 355 * Takes the current active set of markers and stores them for later use. An
y current marker |
356 * in the active set is removed from the active set and the targets remove f
unction is called. | 356 * in the active set is removed from the active set and the targets remove f
unction is called. |
357 * These functions do not work as a stack so you cannot call save a second t
ime before calling | 357 * These functions do not work as a stack so you cannot call save a second t
ime before calling |
358 * restore. Also, it is assumed that when restore is called the current acti
ve set of markers | 358 * restore. Also, it is assumed that when restore is called the current acti
ve set of markers |
359 * is empty. When the stored markers are added back into the active set, the
targets add marker | 359 * is empty. When the stored markers are added back into the active set, the
targets add marker |
360 * is called. | 360 * is called. |
361 */ | 361 */ |
362 void saveActiveTraceMarkers(); | 362 void saveActiveTraceMarkers(); |
363 void restoreActiveTraceMarkers(); | 363 void restoreActiveTraceMarkers(); |
364 | 364 |
| 365 // creation and deletion of raw texture for testing |
| 366 virtual GrBackendObject createBackendTexture(void* pixels, int w, int h, |
| 367 GrPixelConfig config) const = 0
; |
| 368 virtual bool isBackendTexture(GrBackendObject id) const = 0; |
| 369 virtual void deleteBackendTexture(GrBackendObject id) const = 0; |
| 370 |
365 // Given a rt, find or create a stencil buffer and attach it | 371 // Given a rt, find or create a stencil buffer and attach it |
366 bool attachStencilAttachmentToRenderTarget(GrRenderTarget* target); | 372 bool attachStencilAttachmentToRenderTarget(GrRenderTarget* target); |
367 | 373 |
368 // This is only to be used in tests. | 374 // This is only to be used in GL-specific tests. |
369 virtual const GrGLContext* glContextForTesting() const { return NULL; } | 375 virtual const GrGLContext* glContextForTesting() const { return NULL; } |
370 | 376 |
371 protected: | 377 protected: |
372 // Functions used to map clip-respecting stencil tests into normal | 378 // Functions used to map clip-respecting stencil tests into normal |
373 // stencil funcs supported by GPUs. | 379 // stencil funcs supported by GPUs. |
374 static GrStencilFunc ConvertStencilFunc(bool stencilInClip, | 380 static GrStencilFunc ConvertStencilFunc(bool stencilInClip, |
375 GrStencilFunc func); | 381 GrStencilFunc func); |
376 static void ConvertStencilFuncAndMask(GrStencilFunc func, | 382 static void ConvertStencilFuncAndMask(GrStencilFunc func, |
377 bool clipInStencil, | 383 bool clipInStencil, |
378 unsigned int clipBit, | 384 unsigned int clipBit, |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
467 GrTraceMarkerSet fActiveT
raceMarkers; | 473 GrTraceMarkerSet fActiveT
raceMarkers; |
468 GrTraceMarkerSet fStoredT
raceMarkers; | 474 GrTraceMarkerSet fStoredT
raceMarkers; |
469 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 475 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
470 GrContext* fContext
; | 476 GrContext* fContext
; |
471 | 477 |
472 friend class GrPathRendering; | 478 friend class GrPathRendering; |
473 typedef SkRefCnt INHERITED; | 479 typedef SkRefCnt INHERITED; |
474 }; | 480 }; |
475 | 481 |
476 #endif | 482 #endif |
OLD | NEW |