diff options
author | Derek Sollenberger <djsollen@google.com> | 2012-03-06 09:06:43 -0500 |
---|---|---|
committer | Derek Sollenberger <derek@android.com> | 2012-03-06 09:44:47 -0500 |
commit | 4f1dae40e24d57d647db01443b8bf2410514b8b5 (patch) | |
tree | 594df3f3fc6c1d90a76691a75763ae1beacfdf98 /samplecode | |
parent | 1cab2921ab279367f8206cdadc9259d12e603548 (diff) | |
download | external_skia-4f1dae40e24d57d647db01443b8bf2410514b8b5.zip external_skia-4f1dae40e24d57d647db01443b8bf2410514b8b5.tar.gz external_skia-4f1dae40e24d57d647db01443b8bf2410514b8b5.tar.bz2 |
Skia Merge (revision 3312)
This CL also includes changes made to Android's copy of
Skia in their J release branch.
Change-Id: Ib2baecf48004951a3ad4a1574cdc38790c814cbc
Diffstat (limited to 'samplecode')
-rw-r--r-- | samplecode/SampleApp.cpp | 13 | ||||
-rw-r--r-- | samplecode/SamplePath.cpp | 3 | ||||
-rw-r--r-- | samplecode/SampleTextOnPath.cpp | 3 |
3 files changed, 15 insertions, 4 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index 95923c8..51d42b6 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -22,7 +22,7 @@ #include "GrContext.h" #include "SkTypeface.h" -#include "GrGLInterface.h" +#include "gl/GrGLInterface.h" #include "GrRenderTarget.h" #include "SkPDFDevice.h" @@ -1544,6 +1544,17 @@ bool SampleWindow::onHandleChar(SkUnichar uni) { this->updateTitle(); } return true; + case 'p': + { + GrContext* grContext = this->getGrContext(); + if (grContext) { + size_t cacheBytes = grContext->getGpuTextureCacheBytes(); + grContext->freeGpuResources(); + SkDebugf("Purged %d bytes from the GPU resource cache.\n", + cacheBytes); + } + } + return true; case 's': fScale = !fScale; this->inval(NULL); diff --git a/samplecode/SamplePath.cpp b/samplecode/SamplePath.cpp index 7e2750a..ddfbb71 100644 --- a/samplecode/SamplePath.cpp +++ b/samplecode/SamplePath.cpp @@ -67,7 +67,8 @@ static void test_cubic2() { SkIRect ir; r.round(&ir); printf("[%g %g %g %g] [%x %x %x %x]\n", - r.fLeft, r.fTop, r.fRight, r.fBottom, + SkScalarToDouble(r.fLeft), SkScalarToDouble(r.fTop), + SkScalarToDouble(r.fRight), SkScalarToDouble(r.fBottom), ir.fLeft, ir.fTop, ir.fRight, ir.fBottom); } diff --git a/samplecode/SampleTextOnPath.cpp b/samplecode/SampleTextOnPath.cpp index f3c98f8..2b73e9a 100644 --- a/samplecode/SampleTextOnPath.cpp +++ b/samplecode/SampleTextOnPath.cpp @@ -117,7 +117,7 @@ static void test_textBounds(SkCanvas* canvas) { paint.setAntiAlias(true); paint.setDevKernText(gDevKern); - (void)paint.measureText(gText, strlen(gText), &bounds, NULL); + (void)paint.measureText(gText, strlen(gText), &bounds); paint.setColor(SK_ColorGREEN); bounds.offset(x, y); canvas->drawRect(bounds, paint); @@ -288,4 +288,3 @@ static SkView* MyFactory() { } static SkViewRegister reg(MyFactory); - |