| 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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 /** | 44 /** |
| 45 * Create an instance of GrGpu that matches the specified backend. If the re
quested backend is | 45 * Create an instance of GrGpu that matches the specified backend. If the re
quested backend is |
| 46 * not supported (at compile-time or run-time) this returns NULL. The contex
t will not be | 46 * not supported (at compile-time or run-time) this returns NULL. The contex
t will not be |
| 47 * fully constructed and should not be used by GrGpu until after this functi
on returns. | 47 * fully constructed and should not be used by GrGpu until after this functi
on returns. |
| 48 */ | 48 */ |
| 49 static GrGpu* Create(GrBackend, GrBackendContext, GrContext* context); | 49 static GrGpu* Create(GrBackend, GrBackendContext, GrContext* context); |
| 50 | 50 |
| 51 //////////////////////////////////////////////////////////////////////////// | 51 //////////////////////////////////////////////////////////////////////////// |
| 52 | 52 |
| 53 GrGpu(GrContext* context); | 53 GrGpu(GrContext* context); |
| 54 virtual ~GrGpu(); | 54 ~GrGpu() SK_OVERRIDE; |
| 55 | 55 |
| 56 GrContext* getContext() { return fContext; } | 56 GrContext* getContext() { return fContext; } |
| 57 const GrContext* getContext() const { return fContext; } | 57 const GrContext* getContext() const { return fContext; } |
| 58 | 58 |
| 59 /** | 59 /** |
| 60 * Gets the capabilities of the draw target. | 60 * Gets the capabilities of the draw target. |
| 61 */ | 61 */ |
| 62 const GrDrawTargetCaps* caps() const { return fCaps.get(); } | 62 const GrDrawTargetCaps* caps() const { return fCaps.get(); } |
| 63 | 63 |
| 64 GrPathRendering* pathRendering() { | 64 GrPathRendering* pathRendering() { |
| (...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 350 | 350 |
| 351 // Called to perform a surface to surface copy. Fallbacks to issuing a draw
from the src to dst | 351 // Called to perform a surface to surface copy. Fallbacks to issuing a draw
from the src to dst |
| 352 // take place at the GrDrawTarget level and this function implement faster c
opy paths. The rect | 352 // take place at the GrDrawTarget level and this function implement faster c
opy paths. The rect |
| 353 // and point are pre-clipped. The src rect and implied dst rect are guarante
ed to be within the | 353 // and point are pre-clipped. The src rect and implied dst rect are guarante
ed to be within the |
| 354 // src/dst bounds and non-empty. | 354 // src/dst bounds and non-empty. |
| 355 virtual bool copySurface(GrSurface* dst, | 355 virtual bool copySurface(GrSurface* dst, |
| 356 GrSurface* src, | 356 GrSurface* src, |
| 357 const SkIRect& srcRect, | 357 const SkIRect& srcRect, |
| 358 const SkIPoint& dstPoint) = 0; | 358 const SkIPoint& dstPoint) = 0; |
| 359 | 359 |
| 360 virtual void draw(const GrOptDrawState&, const GrDrawTarget::DrawInfo&); | 360 void draw(const GrOptDrawState&, const GrDrawTarget::DrawInfo&); |
| 361 virtual void stencilPath(const GrOptDrawState&, | 361 void stencilPath(const GrOptDrawState&, const GrPath*, const GrStencilSettin
gs&); |
| 362 const GrPath*, | 362 void drawPath(const GrOptDrawState&, const GrPath*, const GrStencilSettings&
); |
| 363 const GrStencilSettings&); | 363 void drawPaths(const GrOptDrawState&, |
| 364 virtual void drawPath(const GrOptDrawState&, | 364 const GrPathRange*, |
| 365 const GrPath*, | 365 const void* indices, |
| 366 const GrStencilSettings&); | 366 GrDrawTarget::PathIndexType, |
| 367 virtual void drawPaths(const GrOptDrawState&, | 367 const float transformValues[], |
| 368 const GrPathRange*, | 368 GrDrawTarget::PathTransformType, |
| 369 const void* indices, | 369 int count, |
| 370 GrDrawTarget::PathIndexType, | 370 const GrStencilSettings&); |
| 371 const float transformValues[], | |
| 372 GrDrawTarget::PathTransformType, | |
| 373 int count, | |
| 374 const GrStencilSettings&); | |
| 375 | 371 |
| 376 static DrawType PrimTypeToDrawType(GrPrimitiveType type) { | 372 static DrawType PrimTypeToDrawType(GrPrimitiveType type) { |
| 377 switch (type) { | 373 switch (type) { |
| 378 case kTriangles_GrPrimitiveType: | 374 case kTriangles_GrPrimitiveType: |
| 379 case kTriangleStrip_GrPrimitiveType: | 375 case kTriangleStrip_GrPrimitiveType: |
| 380 case kTriangleFan_GrPrimitiveType: | 376 case kTriangleFan_GrPrimitiveType: |
| 381 return kDrawTriangles_DrawType; | 377 return kDrawTriangles_DrawType; |
| 382 case kPoints_GrPrimitiveType: | 378 case kPoints_GrPrimitiveType: |
| 383 return kDrawPoints_DrawType; | 379 return kDrawPoints_DrawType; |
| 384 case kLines_GrPrimitiveType: | 380 case kLines_GrPrimitiveType: |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 500 int fGpuTrac
eMarkerCount; | 496 int fGpuTrac
eMarkerCount; |
| 501 GrTraceMarkerSet fActiveT
raceMarkers; | 497 GrTraceMarkerSet fActiveT
raceMarkers; |
| 502 GrTraceMarkerSet fStoredT
raceMarkers; | 498 GrTraceMarkerSet fStoredT
raceMarkers; |
| 503 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. | 499 // The context owns us, not vice-versa, so this ptr is not ref'ed by Gpu. |
| 504 GrContext* fContext
; | 500 GrContext* fContext
; |
| 505 | 501 |
| 506 typedef SkRefCnt INHERITED; | 502 typedef SkRefCnt INHERITED; |
| 507 }; | 503 }; |
| 508 | 504 |
| 509 #endif | 505 #endif |
| OLD | NEW |