diff options
| author | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-01-21 21:03:59 +0000 |
|---|---|---|
| committer | bsalomon@google.com <bsalomon@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-01-21 21:03:59 +0000 |
| commit | 5782d712ffc31557d0cb12d5a220cebb783f6895 (patch) | |
| tree | cdc0b2fb6d9b60ddca81eb7fb6a3906035d29875 /samplecode/SampleApp.cpp | |
| parent | 70915f0210a8749553cbb93b12b2963cf350fff6 (diff) | |
Rev the GrContext interface. Context has draw* functions that take a new GrPaint object. Removed many of the lower-level GrGpu function call-throughs on context.
Remove unused/unsupported point size (we don't draw non-hairline points using GL points).
Change current* getter functions to get* for consistency.
Fix bounds when drawing inverse-filled paths.
git-svn-id: http://skia.googlecode.com/svn/trunk@718 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'samplecode/SampleApp.cpp')
| -rw-r--r-- | samplecode/SampleApp.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index bf8cb6bc01..e77562afef 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -167,7 +167,6 @@ private: SkPicture* fPicture; SkGpuCanvas* fGpuCanvas; GrContext* fGrContext; - GrRenderTarget* fGrRenderTarget; SkPath fClipPath; enum CanvasType { @@ -219,19 +218,14 @@ bool SampleWindow::make3DReady() { #endif if (NULL == fGrContext) { - SkASSERT(NULL == fGrRenderTarget); #if defined(SK_USE_SHADERS) fGrContext = GrContext::Create(GrGpu::kOpenGL_Shaders_Engine, NULL); #else fGrContext = GrContext::Create(GrGpu::kOpenGL_Fixed_Engine, NULL); #endif - if (NULL != fGrContext) { - fGrRenderTarget = fGrContext->createRenderTargetFrom3DApiState(); - } } if (NULL != fGrContext) { - SkASSERT(NULL != fGrRenderTarget); return true; } else { detachGL(); @@ -255,7 +249,6 @@ SampleWindow::SampleWindow(void* hwnd) : INHERITED(hwnd) { fGpuCanvas = NULL; fGrContext = NULL; - fGrRenderTarget = NULL; #ifdef DEFAULT_TO_GPU fCanvasType = kGPU_CanvasType; @@ -291,9 +284,6 @@ SampleWindow::SampleWindow(void* hwnd) : INHERITED(hwnd) { SampleWindow::~SampleWindow() { delete fPicture; delete fGpuCanvas; - if (NULL != fGrRenderTarget) { - fGrRenderTarget->unref(); - } if (NULL != fGrContext) { fGrContext->unref(); } @@ -414,7 +404,11 @@ SkCanvas* SampleWindow::beforeChildren(SkCanvas* canvas) { SkDevice* device = canvas->getDevice(); const SkBitmap& bitmap = device->accessBitmap(true); - fGpuCanvas = new SkGpuCanvas(fGrContext, fGrRenderTarget); + GrRenderTarget* renderTarget; + renderTarget = fGrContext->createRenderTargetFrom3DApiState(); + fGpuCanvas = new SkGpuCanvas(fGrContext, renderTarget); + renderTarget->unref(); + device = fGpuCanvas->createDevice(SkBitmap::kARGB_8888_Config, bitmap.width(), bitmap.height(), false, false); |
