class MathBenchU32 : public MathBench {
public:
MathBenchU32(void* param, const char name[]) : INHERITED(param, name) {}
-
+
protected:
virtual void performITest(uint32_t* SK_RESTRICT dst,
const uint32_t* SK_RESTRICT src,
int count) = 0;
-
+
virtual void performTest(float* SK_RESTRICT dst,
const float* SK_RESTRICT src,
int count) SK_OVERRIDE {
uint32_t fData[ARRAY];
bool fUsePortable;
-public:
+public:
CLZBench(void* param, bool usePortable)
: INHERITED(param)
, fUsePortable(usePortable) {
for (int i = 0; i < ARRAY; ++i) {
fData[i] = rand.nextU();
}
-
+
if (fUsePortable) {
fName = "clz_portable";
} else {
}
fIsRendering = false;
}
-
+
// just so the compiler doesn't remove our loops
virtual void process(int) {}
-
+
protected:
virtual void onDraw(SkCanvas*) {
int accum = 0;
-
+
if (fUsePortable) {
for (int j = 0; j < LOOP; ++j) {
for (int i = 0; i < ARRAY; ++i) {
}
}
}
-
+
virtual const char* onGetName() {
return fName;
}
-
+
private:
const char* fName;
-
+
typedef SkBenchmark INHERITED;
};
fRQ.fPts[2].set(100, 100);
fRQ.fW = SkScalarCos(SK_ScalarPI/4);
}
-
+
private:
virtual const char* onGetName() SK_OVERRIDE {
return "ratquad-chop-half";
}
-
+
virtual void onDraw(SkCanvas*) SK_OVERRIDE {
SkConic dst[2];
for (int i = 0; i < N; ++i) {
fRQ.chop(dst);
}
}
-
+
typedef SkBenchmark INHERITED;
};
}
fIsRendering = false;
}
-
+
protected:
enum {
N = 20000,
CONICS = 100
};
SkConic fConics[CONICS];
-
+
private:
typedef SkBenchmark INHERITED;
};
class ConicBench_ComputeError : public ConicBench {
public:
ConicBench_ComputeError(void* param) : INHERITED(param) {}
-
+
protected:
virtual const char* onGetName() SK_OVERRIDE {
return "conic-compute-error";
}
-
+
virtual void onDraw(SkCanvas*) SK_OVERRIDE {
SkVector err;
for (int i = 0; i < N; ++i) {
}
}
}
-
+
private:
typedef ConicBench INHERITED;
};
class ConicBench_asQuadTol : public ConicBench {
public:
ConicBench_asQuadTol(void* param) : INHERITED(param) {}
-
+
protected:
virtual const char* onGetName() SK_OVERRIDE {
return "conic-asQuadTol";
}
-
+
virtual void onDraw(SkCanvas*) SK_OVERRIDE {
for (int i = 0; i < N; ++i) {
for (int j = 0; j < CONICS; ++j) {
}
}
}
-
+
private:
typedef ConicBench INHERITED;
};
virtual const char* onGetName() SK_OVERRIDE {
return "conic-quadPow2";
}
-
+
virtual void onDraw(SkCanvas*) SK_OVERRIDE {
for (int i = 0; i < N; ++i) {
for (int j = 0; j < CONICS; ++j) {
}
}
}
-
+
private:
typedef ConicBench INHERITED;
};
DEF_BENCH( return new ConicBench_ComputeError(p) )
DEF_BENCH( return new ConicBench_asQuadTol(p) )
DEF_BENCH( return new ConicBench_quadPow2(p) )
-
return;
}
env->CallVoidMethod(gWindowGlue.m_obj,
- gWindowGlue.m_startTimer, ms);
+ gWindowGlue.m_startTimer, ms);
}
void SkEvent::SignalNonEmptyQueue()
JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_init(JNIEnv* env,
jobject thiz, jobject jsampleActivity)
{
- // setup jni hooks to the java activity
+ // setup jni hooks to the java activity
gActivityGlue.m_env = env;
jclass clazz = env->FindClass("com/skia/SkiaSampleActivity");
gActivityGlue.m_obj = env->NewWeakGlobalRef(jsampleActivity);
JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_nextSample(
JNIEnv* env, jobject thiz)
{
- gWindow->nextSample();
+ gWindow->nextSample();
}
JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_previousSample(
JNIEnv* env, jobject thiz)
{
- gWindow->previousSample();
+ gWindow->previousSample();
}
JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_goToSample(
JNIEnv* env, jobject thiz, jint position)
{
- gWindow->goToSample(position);
+ gWindow->goToSample(position);
}
JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_toggleRenderingMode(
JNIEXPORT void JNICALL Java_com_skia_SkiaSampleRenderer_postInval(
JNIEnv* env, jobject thiz)
{
- gWindow->postInvalDelay();
+ gWindow->postInvalDelay();
}
# This GYP file stores the dependencies necessary to build Skia on the Android
# platform. The OS doesn't provide many stable libraries as part of the
-# distribution so we have to build a few of them ourselves.
+# distribution so we have to build a few of them ourselves.
#
-# NOTE: We tried adding the gyp file to the android/ directory at the root of
+# NOTE: We tried adding the gyp file to the android/ directory at the root of
# the Skia repo, but that resulted in the generated makefiles being created
# outside of the out directory. We may be able to move the bulk of this gyp
# to the /android directory and put a simple shim here, but that has yet to be
-# tested.
+# tested.
{
'variables': {
'direct_dependent_settings': {
'target_conditions': [
# '_type' is an 'automatic variable' which is defined for any
- # target which defines a key-value pair with 'type' as the key (so,
+ # target which defines a key-value pair with 'type' as the key (so,
# all of them). Conditionals inside 'target_conditions' are evaluated
# *after* all other definitions and conditionals are evaluated, so
# we're guaranteed that '_type' will be defined when we get here.
'direct_dependent_settings': {
'target_conditions': [
# '_type' is an 'automatic variable' which is defined for any
- # target which defines a key-value pair with 'type' as the key (so,
+ # target which defines a key-value pair with 'type' as the key (so,
# all of them). Conditionals inside 'target_conditions' are evaluated
# *after* all other definitions and conditionals are evaluated, so
# we're guaranteed that '_type' will be defined when we get here.
GrGLsizei height) {
}
-GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDiscardFramebuffer(GrGLenum target,
- GrGLsizei numAttachments,
+GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDiscardFramebuffer(GrGLenum target,
+ GrGLsizei numAttachments,
const GrGLenum* attachments) {
}
GrGLsizei width,
GrGLsizei height);
-GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDiscardFramebuffer(GrGLenum target,
- GrGLsizei numAttachments,
+GrGLvoid GR_GL_FUNCTION_TYPE noOpGLDiscardFramebuffer(GrGLenum target,
+ GrGLsizei numAttachments,
const GrGLenum* attachments);
GrGLvoid GR_GL_FUNCTION_TYPE noOpGLTexSubImage2D(GrGLenum target,
REPORTER_ASSERT(reporter, 31 == SkCLZ(1));
REPORTER_ASSERT(reporter, 1 == SkCLZ(1 << 30));
REPORTER_ASSERT(reporter, 0 == SkCLZ(~0U));
-
+
SkRandom rand;
for (int i = 0; i < 1000; ++i) {
uint32_t mask = rand.nextU();