It seems no GM are using this.

BUG=None
TEST=SampleApp
R=bsalomon@google.com, caryclark@google.com

Author: tfarina@chromium.org

Review URL: https://codereview.chromium.org/144543003

git-svn-id: http://skia.googlecode.com/svn/trunk@13141 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
commit-bot@chromium.org 2014-01-22 14:43:47 +00:00
Родитель 566a3f1a1f
Коммит 7873333236
3 изменённых файлов: 5 добавлений и 36 удалений

Просмотреть файл

@ -7,30 +7,14 @@
#include "gm.h"
#if SK_SUPPORT_GPU
#include "SkGpuDevice.h"
#else
class GrContext;
#endif
static void make_bitmap(SkBitmap* bitmap, GrContext* ctx, SkIRect* center) {
SkBaseDevice* dev;
static void make_bitmap(SkBitmap* bitmap, SkIRect* center) {
const int kFixed = 28;
const int kStretchy = 8;
const int kSize = 2*kFixed + kStretchy;
#if SK_SUPPORT_GPU
if (ctx) {
dev = new SkGpuDevice(ctx, SkBitmap::kARGB_8888_Config, kSize, kSize);
*bitmap = dev->accessBitmap(false);
} else
#endif
{
bitmap->setConfig(SkBitmap::kARGB_8888_Config, kSize, kSize);
bitmap->allocPixels();
dev = new SkBitmapDevice(*bitmap);
}
bitmap->setConfig(SkBitmap::kARGB_8888_Config, kSize, kSize);
bitmap->allocPixels();
SkBaseDevice* dev = new SkBitmapDevice(*bitmap);
SkCanvas canvas(dev);
dev->unref();
@ -75,7 +59,7 @@ protected:
virtual void onDraw(SkCanvas* canvas) {
SkBitmap bm;
SkIRect center;
make_bitmap(&bm, NULL /*SampleCode::GetGr()*/, &center);
make_bitmap(&bm, &center);
// amount of bm that should not be stretched (unless we have to)
const SkScalar fixed = SkIntToScalar(bm.width() - center.width());

Просмотреть файл

@ -642,19 +642,6 @@ SkScalar SampleCode::GetAnimSinScalar(SkScalar amplitude,
return SkScalarMul(amplitude, SkDoubleToScalar(sin(t))) + amplitude;
}
GrContext* SampleCode::GetGr() {
return gSampleWindow ? gSampleWindow->getGrContext() : NULL;
}
// some GMs rely on having a skiagm::GetGr function defined
namespace skiagm {
// FIXME: this should be moved into a header
GrContext* GetGr();
GrContext* GetGr() { return SampleCode::GetGr(); }
}
//////////////////////////////////////////////////////////////////////////////
enum TilingMode {
kNo_Tiling,
kAbs_128x128_Tiling,

Просмотреть файл

@ -39,8 +39,6 @@ public:
static SkScalar GetAnimSinScalar(SkScalar amplitude,
SkScalar periodInSec,
SkScalar phaseInSec = 0);
static GrContext* GetGr();
};
//////////////////////////////////////////////////////////////////////////////