Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Change-Id: Ia710b27d97e938df06014b7b61a3767bd3be1eb5
  • Loading branch information
drWulf committed Nov 13, 2013
1 parent e27eefc commit 0a657bb
Show file tree
Hide file tree
Showing 1,764 changed files with 697,540 additions and 157,138 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ deps = {
"third_party/externals/angle" : "https://chromium.googlesource.com/external/angleproject.git@e574e26f48223a6718feab841b4a7720785b497a",
"third_party/externals/fontconfig" : "https://skia.googlesource.com/third_party/fontconfig.git@2.10.93",
"third_party/externals/freetype" : "https://skia.googlesource.com/third_party/freetype2.git@VER-2-5-0-1",
"third_party/externals/gyp" : "https://chromium.googlesource.com/external/gyp.git@e5179456241c17cb6cdd106e4744882d32081df5",
"third_party/externals/gyp" : "https://chromium.googlesource.com/external/gyp.git@0635a6e266eb4cdd01e942331997f76b3737be79",
"third_party/externals/iconv" : "https://skia.googlesource.com/third_party/libiconv.git@v1.14",
"third_party/externals/libjpeg" : "https://chromium.googlesource.com/chromium/deps/libjpeg_turbo.git@82ce8a6d4ebe12a177c0c3597192f2b4f09e81c3",
"third_party/externals/jsoncpp" : "https://chromium.googlesource.com/external/jsoncpp/jsoncpp.git@ab1e40f3bce061ea6f9bdc60351d6cde2a4f872b",
Expand Down
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ VALID_TARGETS := \
SampleApp_APK \
skhello \
skia_lib \
skpskgr_test \
tests \
tools \
skpdiff
Expand Down
4 changes: 1 addition & 3 deletions Makefile.old
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ else
DEFINES += -DSK_RELEASE -DGR_DEBUG=0
endif

DEFINES += -DGR_IMPLEMENTATION=1

ifneq ($(SKIA_PDF_SUPPORT),false)
DEFINES += -DSK_SUPPORT_PDF
DEFINES += -DSK_ZLIB_INCLUDE="<zlib.h>"
Expand Down Expand Up @@ -134,7 +132,7 @@ ifeq ($(SKIA_BUILD_FOR),mac)

else
LINKER_OPTS += -lpng -lfreetype -lrt
DEFINES += -DSK_BUILD_FOR_UNIX -DSK_ENABLE_LIBPNG -DGR_LINUX_BUILD=1
DEFINES += -DSK_BUILD_FOR_UNIX -DSK_ENABLE_LIBPNG
ifeq ($(SKIA_MESA),true)
LINKER_OPTS += -lOSMesa -lGLU
DEFINES += -DSK_MESA
Expand Down
2 changes: 2 additions & 0 deletions OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
reed@google.com
bsalomon@google.com
5 changes: 5 additions & 0 deletions README.chromium
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Name: skia
URL: http://code.google.com/p/skia
Version: unknown
Security Critical: yes
License: BSD
73 changes: 20 additions & 53 deletions bench/AAClipBench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,9 @@ class AAClipBench : public SkBenchmark {
bool fDoPath;
bool fDoAA;

enum {
N = SkBENCHLOOP(200),
};

public:
AAClipBench(void* param, bool doPath, bool doAA)
: INHERITED(param)
, fDoPath(doPath)
AAClipBench(bool doPath, bool doAA)
: fDoPath(doPath)
, fDoAA(doAA) {

fName.printf("aaclip_%s_%s",
Expand All @@ -53,7 +48,7 @@ class AAClipBench : public SkBenchmark {
SkPaint paint;
this->setupPaint(&paint);

for (int i = 0; i < N; ++i) {
for (int i = 0; i < this->getLoops(); ++i) {
// jostle the clip regions each time to prevent caching
fClipRect.offset((i % 2) == 0 ? SkIntToScalar(10) : SkIntToScalar(-10), 0);
fClipPath.reset();
Expand Down Expand Up @@ -96,17 +91,13 @@ class NestedAAClipBench : public SkBenchmark {
SkRect fDrawRect;
SkRandom fRandom;

static const int kNumDraws = SkBENCHLOOP(2);
static const int kNestingDepth = 3;
static const int kImageSize = 400;

SkPoint fSizes[kNestingDepth+1];

public:
NestedAAClipBench(void* param, bool doAA)
: INHERITED(param)
, fDoAA(doAA) {

NestedAAClipBench(bool doAA) : fDoAA(doAA) {
fName.printf("nested_aaclip_%s", doAA ? "AA" : "BW");

fDrawRect = SkRect::MakeLTRB(0, 0,
Expand Down Expand Up @@ -169,7 +160,7 @@ class NestedAAClipBench : public SkBenchmark {

virtual void onDraw(SkCanvas* canvas) {

for (int i = 0; i < kNumDraws; ++i) {
for (int i = 0; i < this->getLoops(); ++i) {
SkPoint offset = SkPoint::Make(0, 0);
this->recurse(canvas, 0, offset);
}
Expand All @@ -188,12 +179,8 @@ class AAClipBuilderBench : public SkBenchmark {
bool fDoPath;
bool fDoAA;

enum {
N = SkBENCHLOOP(200),
};

public:
AAClipBuilderBench(void* param, bool doPath, bool doAA) : INHERITED(param) {
AAClipBuilderBench(bool doPath, bool doAA) {
fDoPath = doPath;
fDoAA = doAA;

Expand All @@ -212,7 +199,7 @@ class AAClipBuilderBench : public SkBenchmark {
SkPaint paint;
this->setupPaint(&paint);

for (int i = 0; i < N; ++i) {
for (int i = 0; i < this->getLoops(); ++i) {
SkAAClip clip;
if (fDoPath) {
clip.setPath(fPath, &fRegion, fDoAA);
Expand All @@ -228,7 +215,7 @@ class AAClipBuilderBench : public SkBenchmark {
////////////////////////////////////////////////////////////////////////////////
class AAClipRegionBench : public SkBenchmark {
public:
AAClipRegionBench(void* param) : INHERITED(param) {
AAClipRegionBench() {
SkPath path;
// test conversion of a complex clip to a aaclip
path.addCircle(0, 0, SkIntToScalar(200));
Expand All @@ -244,47 +231,27 @@ class AAClipRegionBench : public SkBenchmark {
protected:
virtual const char* onGetName() { return "aaclip_setregion"; }
virtual void onDraw(SkCanvas*) {
for (int i = 0; i < N; ++i) {
for (int i = 0; i < this->getLoops(); ++i) {
SkAAClip clip;
clip.setRegion(fRegion);
}
}

private:
enum {
N = SkBENCHLOOP(400),
};
SkRegion fRegion;
typedef SkBenchmark INHERITED;
};

////////////////////////////////////////////////////////////////////////////////

static SkBenchmark* Fact0(void* p) { return SkNEW_ARGS(AAClipBuilderBench, (p, false, false)); }
static SkBenchmark* Fact1(void* p) { return SkNEW_ARGS(AAClipBuilderBench, (p, false, true)); }
static SkBenchmark* Fact2(void* p) { return SkNEW_ARGS(AAClipBuilderBench, (p, true, false)); }
static SkBenchmark* Fact3(void* p) { return SkNEW_ARGS(AAClipBuilderBench, (p, true, true)); }

static BenchRegistry gReg0(Fact0);
static BenchRegistry gReg1(Fact1);
static BenchRegistry gReg2(Fact2);
static BenchRegistry gReg3(Fact3);

static SkBenchmark* Fact01(void* p) { return SkNEW_ARGS(AAClipRegionBench, (p)); }
static BenchRegistry gReg01(Fact01);

static SkBenchmark* Fact000(void* p) { return SkNEW_ARGS(AAClipBench, (p, false, false)); }
static SkBenchmark* Fact001(void* p) { return SkNEW_ARGS(AAClipBench, (p, false, true)); }
static SkBenchmark* Fact002(void* p) { return SkNEW_ARGS(AAClipBench, (p, true, false)); }
static SkBenchmark* Fact003(void* p) { return SkNEW_ARGS(AAClipBench, (p, true, true)); }

static BenchRegistry gReg000(Fact000);
static BenchRegistry gReg001(Fact001);
static BenchRegistry gReg002(Fact002);
static BenchRegistry gReg003(Fact003);

static SkBenchmark* Fact004(void* p) { return SkNEW_ARGS(NestedAAClipBench, (p, false)); }
static SkBenchmark* Fact005(void* p) { return SkNEW_ARGS(NestedAAClipBench, (p, true)); }

static BenchRegistry gReg004(Fact004);
static BenchRegistry gReg005(Fact005);
DEF_BENCH( return SkNEW_ARGS(AAClipBuilderBench, (false, false)); )
DEF_BENCH( return SkNEW_ARGS(AAClipBuilderBench, (false, true)); )
DEF_BENCH( return SkNEW_ARGS(AAClipBuilderBench, (true, false)); )
DEF_BENCH( return SkNEW_ARGS(AAClipBuilderBench, (true, true)); )
DEF_BENCH( return SkNEW_ARGS(AAClipRegionBench, ()); )
DEF_BENCH( return SkNEW_ARGS(AAClipBench, (false, false)); )
DEF_BENCH( return SkNEW_ARGS(AAClipBench, (false, true)); )
DEF_BENCH( return SkNEW_ARGS(AAClipBench, (true, false)); )
DEF_BENCH( return SkNEW_ARGS(AAClipBench, (true, true)); )
DEF_BENCH( return SkNEW_ARGS(NestedAAClipBench, (false)); )
DEF_BENCH( return SkNEW_ARGS(NestedAAClipBench, (true)); )
32 changes: 14 additions & 18 deletions bench/BicubicBench.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

#include "SkBenchmark.h"
#include "SkCanvas.h"
#include "SkRandom.h"
#include "SkShader.h"
#include "SkString.h"
#include "SkBicubicImageFilter.h"
Expand All @@ -20,10 +19,10 @@ class BicubicBench : public SkBenchmark {
SkString fName;

public:
BicubicBench(void* param, float x, float y)
: INHERITED(param), fScale(SkSize::Make(SkFloatToScalar(x), SkFloatToScalar(y))) {
BicubicBench(float x, float y)
: fScale(SkSize::Make(SkFloatToScalar(x), SkFloatToScalar(y))) {
fName.printf("bicubic_%gx%g",
SkScalarToFloat(fScale.fWidth), SkScalarToFloat(fScale.fHeight));
SkScalarToFloat(fScale.fWidth), SkScalarToFloat(fScale.fHeight));
}

protected:
Expand All @@ -37,26 +36,23 @@ class BicubicBench : public SkBenchmark {

paint.setAntiAlias(true);

SkRandom rand;
SkRect r = SkRect::MakeWH(40, 40);
SkAutoTUnref<SkImageFilter> bicubic(SkBicubicImageFilter::CreateMitchell(fScale));
paint.setImageFilter(bicubic);
canvas->save();
canvas->clipRect(r);
canvas->drawOval(r, paint);
canvas->restore();

for (int i = 0; i < this->getLoops(); i++) {
canvas->save();
canvas->clipRect(r);
canvas->drawOval(r, paint);
canvas->restore();
}
}

private:
typedef SkBenchmark INHERITED;
};

static SkBenchmark* Fact00(void* p) { return new BicubicBench(p, 10.0f, 10.0f); }
static SkBenchmark* Fact01(void* p) { return new BicubicBench(p, 2.5f, 10.0f); }
static SkBenchmark* Fact02(void* p) { return new BicubicBench(p, 10.0f, 2.5f); }
static SkBenchmark* Fact03(void* p) { return new BicubicBench(p, 2.5f, 2.5f); }

static BenchRegistry gReg00(Fact00);
static BenchRegistry gReg01(Fact01);
static BenchRegistry gReg02(Fact02);
static BenchRegistry gReg03(Fact03);
DEF_BENCH( return new BicubicBench(10.0f, 10.0f); )
DEF_BENCH( return new BicubicBench(2.5f, 10.0f); )
DEF_BENCH( return new BicubicBench(10.0f, 2.5f); )
DEF_BENCH( return new BicubicBench(2.5f, 2.5f); )
Loading

0 comments on commit 0a657bb

Please sign in to comment.