///////////////////////////////////////////////////////////////////////////////
+SkView* create_debugger(const char* data, size_t size);
+
SkView* create_debugger(const char* data, size_t size) {
return SkNEW_ARGS(DebuggerView, (data, size));
};
+bool is_debugger(SkView* view);
+
bool is_debugger(SkView* view) {
SkEvent isDebugger(gIsDebuggerQuery);
return view->doQuery(&isDebugger);
virtual SkISize onISize() { return make_isize(500, 480); }
virtual void onDraw(SkCanvas* canvas) {
SkPaint paint;
- const SkISize& size = this->getISize();
SkRect r = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100));
canvas->clipRect(r);
virtual SkISize onISize() { return make_isize(500, 480); }
virtual void onDraw(SkCanvas* canvas) {
SkPaint paint;
- const SkISize& size = this->getISize();
SkRect r = SkRect::MakeWH(SkIntToScalar(100), SkIntToScalar(100));
#define testInt(expression) { #expression, SkOperand2::kS32, expression, 0, NULL }
#ifdef SK_SCALAR_IS_FLOAT
-#define testScalar(expression) { #expression, SkOperand2::kScalar, 0, (float) expression, NULL }
-#define testRemainder(exp1, exp2) { #exp1 "%" #exp2, SkOperand2::kScalar, 0, fmodf(exp1, exp2), NULL }
+#define testScalar(expression) { #expression, SkOperand2::kScalar, 0, (float) (expression), NULL }
+#define testRemainder(exp1, exp2) { #exp1 "%" #exp2, SkOperand2::kScalar, 0, fmodf((float) exp1, (float) exp2), NULL }
#else
#define testScalar(expression) { #expression, SkOperand2::kScalar, 0, (int) ((expression) * 65536.0f), NULL }
#define testRemainder(exp1, exp2) { #exp1 "%" #exp2, SkOperand2::kScalar, 0, (int) (fmod(exp1, exp2) * 65536.0f), NULL }
// Can't be static in the general case because some of these implementations
// will be defined and referenced in different object files.
+void SCALE_FILTER_NAME(const SkBitmapProcState& s, int x, int y,
+ DSTTYPE* SK_RESTRICT colors, int count);
+
void SCALE_FILTER_NAME(const SkBitmapProcState& s, int x, int y,
DSTTYPE* SK_RESTRICT colors, int count) {
SkASSERT((s.fInvType & ~(SkMatrix::kTranslate_Mask |
///////////////////////////////////////////////////////////////////////////////
+int32_t SkNextPixelRefGenerationID();
+
int32_t SkNextPixelRefGenerationID() {
static int32_t gPixelRefGenerationID;
// do a loop in case our global wraps around, as we never want to
SkPMColor* SK_RESTRICT dstC = dstCParam;
SkMatrix::MapXYProc dstProc = fDstToIndexProc;
- TileProc proc = fTileProc;
+
const SkPMColor* SK_RESTRICT cache = this->getCache32();
TwoPointRadialProc shadeProc = twopoint_repeat;
SkShader::BitmapType SkTwoPointConicalGradient::asABitmap(
SkBitmap* bitmap, SkMatrix* matrix, SkShader::TileMode* xy) const {
SkPoint diff = fCenter2 - fCenter1;
- SkScalar diffRadius = fRadius2 - fRadius1;
- SkScalar startRadius = fRadius1;
SkScalar diffLen = 0;
if (bitmap) {
return false;
}
+#if GR_SW_CLIP
bool requiresAA = requires_AA(*clipDataIn->fClipStack);
-#if GR_SW_CLIP
// If MSAA is enabled we can do everything in the stencil buffer.
// Otherwise check if we should just create the entire clip mask
// in software (this will only happen if the clip mask is anti-aliased
} else {
uniforms.fTextureMatrixUni = builder->addUniform(GrGLShaderBuilder::kVertex_ShaderType,
kMat33f_GrSLType, "TexM", &matName);
- const GrGLShaderVar& mat = builder->getUniformVariable(uniforms.fTextureMatrixUni);
+ builder->getUniformVariable(uniforms.fTextureMatrixUni);
if (desc.fOptFlags & StageDesc::kNoPerspective_OptFlagBit) {
texCoordVaryingType = kVec2f_GrSLType;
}
namespace {
+
+static const uint16_t kOnes16 = static_cast<uint16_t>(~0);
const GrStencilSettings& winding_nv_path_stencil_settings() {
GR_STATIC_CONST_SAME_STENCIL_STRUCT(gSettings,
kIncClamp_StencilOp,
kIncClamp_StencilOp,
kAlwaysIfInClip_StencilFunc,
- ~0, ~0, ~0);
+ kOnes16, kOnes16, kOnes16);
return *GR_CONST_STENCIL_SETTINGS_PTR_FROM_STRUCT_PTR(&gSettings);
}
const GrStencilSettings& even_odd_nv_path_stencil_settings() {
kInvert_StencilOp,
kInvert_StencilOp,
kAlwaysIfInClip_StencilFunc,
- ~0, ~0, ~0);
+ kOnes16, kOnes16, kOnes16);
return *GR_CONST_STENCIL_SETTINGS_PTR_FROM_STRUCT_PTR(&gSettings);
}
}
this->flushPending();
// Free as much as possible to avoid oscillating around fMaxRecordingStorageBytes
// which could cause a high flushing frequency.
- this->freeMemoryIfPossible(~0);
+ this->freeMemoryIfPossible(~0U);
}
storageAllocated = this->storageAllocatedForRecording();
}
}
}
-int count(const SkClipStack& stack) {
+static int count(const SkClipStack& stack) {
SkClipStack::Iter iter(stack, SkClipStack::Iter::kTop_IterStart);
REPORTER_ASSERT(reporter, canvas.storageAllocatedForRecording() > bitmapSize);
// verify that nothing can be freed at this point
- REPORTER_ASSERT(reporter, 0 == canvas.freeMemoryIfPossible(~0));
+ REPORTER_ASSERT(reporter, 0 == canvas.freeMemoryIfPossible(~0U));
// verify that flush leaves image in cache
REPORTER_ASSERT(reporter, 0 == notificationCounter.fFlushedDrawCommandsCount);
REPORTER_ASSERT(reporter, canvas.storageAllocatedForRecording() >= bitmapSize);
// verify that after a flush, cached image can be freed
- REPORTER_ASSERT(reporter, canvas.freeMemoryIfPossible(~0) >= bitmapSize);
+ REPORTER_ASSERT(reporter, canvas.freeMemoryIfPossible(~0U) >= bitmapSize);
// Verify that caching works for avoiding multiple copies of the same bitmap
canvas.drawBitmap(sourceImages[0], 0, 0, NULL);
// Verifiy that partial purge works, image zero is in cache but not reffed by
// a pending draw, while image 1 is locked-in.
- canvas.freeMemoryIfPossible(~0);
+ canvas.freeMemoryIfPossible(~0U);
REPORTER_ASSERT(reporter, 2 == notificationCounter.fFlushedDrawCommandsCount);
canvas.drawBitmap(sourceImages[0], 0, 0, NULL);
canvas.flush();
canvas.drawBitmap(sourceImages[1], 0, 0, NULL);
- bytesFreed = canvas.freeMemoryIfPossible(~0);
+ bytesFreed = canvas.freeMemoryIfPossible(~0U);
// only one bitmap should have been freed.
REPORTER_ASSERT(reporter, bytesFreed >= bitmapSize);
REPORTER_ASSERT(reporter, bytesFreed < 2*bitmapSize);
// Clear for next test
canvas.flush();
- canvas.freeMemoryIfPossible(~0);
+ canvas.freeMemoryIfPossible(~0U);
REPORTER_ASSERT(reporter, canvas.storageAllocatedForRecording() < bitmapSize);
// Verify the image cache is sensitive to genID bumps
// Returns the Result with this name.
// If there is no Result with this name, returns kNumResultTypes.
// TODO: Is there a better return value for the fall-through case?
-Result getResultByName(const char *name) {
+static Result getResultByName(const char *name) {
if (0 == strcmp("EqualBits", name)) {
return kEqualBits;
}
}
// Returns a text description of the given Result type.
-const char *getResultDescription(Result result) {
+static const char *getResultDescription(Result result) {
switch (result) {
case kEqualBits:
return "contain exactly the same bits";