int offset = 0;
int frameBound = 0;
size_t bytesRead;
- while (offset < size) {
+ while (static_cast<unsigned>(offset) < size) {
SkGPipeReader::Status s = dumpReader->playback(data + offset,
size - offset,
&bytesRead,
}
static void fill_pts(SkPoint pts[], size_t n, SkRandom* rand) {
- for (size_t i = 0; i < n; i++)
- pts[i].set(rand->nextUScalar1() * 640, rand->nextUScalar1() * 480);
+ for (size_t i = 0; i < n; i++) {
+ // Compute these independently and store in variables, rather
+ // than in the parameter-passing expression, to get consistent
+ // evaluation order across compilers.
+ float y = rand->nextUScalar1() * 480;
+ float x = rand->nextUScalar1() * 640;
+ pts[i].set(x, y);
+ }
}
virtual void onDraw(SkCanvas* canvas) {
SkScalar y = rand.nextUScalar1() * H;
SkScalar w = rand.nextUScalar1() * (W >> 2);
SkScalar h = rand.nextUScalar1() * (H >> 2);
+ SkScalar hoffset = rand.nextSScalar1();
+ SkScalar woffset = rand.nextSScalar1();
r->set(x, y, x + w, y + h);
- r->offset(-w/2 + rand.nextSScalar1(), -h/2 + + rand.nextSScalar1());
+ r->offset(-w/2 + woffset, -h/2 + hoffset);
}
virtual void onDraw(SkCanvas* canvas) {
SkScalar y = rand.nextUScalar1() * H;
SkScalar w = rand.nextUScalar1() * (W >> 2);
SkScalar h = rand.nextUScalar1() * (H >> 2);
+ SkScalar hoffset = rand.nextSScalar1();
+ SkScalar woffset = rand.nextSScalar1();
r->set(x, y, x + w, y + h);
- r->offset(-w/2 + rand.nextSScalar1(), -h/2 + + rand.nextSScalar1());
+ r->offset(-w/2 + woffset, -h/2 + hoffset);
paint->setColor(rand.nextU());
paint->setAlpha(0xFF);
return *this;
}
- virtual ~GrBinHashKey() {
+ ~GrBinHashKey() {
}
void setKeyData(const uint32_t *data) {
}
}
fConservativeBoundsValid = false;
- if (isectRectValid) {
+ if (isectRectValid && rectCount) {
+ fConservativeBounds = fList[0].fRect;
fConservativeBoundsValid = true;
- if (rectCount > 0) {
- fConservativeBounds = fList[0].fRect;
- } else {
- fConservativeBounds.setEmpty();
- }
} else if (NULL != conservativeBounds) {
fConservativeBounds = *conservativeBounds;
fConservativeBoundsValid = true;
GrGpu* GrGpu::Create(GrEngine engine, GrPlatform3DContext context3D) {
- const GrGLInterface* glInterface;
+ const GrGLInterface* glInterface = NULL;
if (kOpenGL_Shaders_GrEngine == engine ||
kOpenGL_Fixed_GrEngine == engine) {
GrPathRendererChain::GrPathRendererChain(GrContext* context, UsageFlags flags)
: fInit(false)
- , fFlags(flags)
, fOwner(context)
+ , fFlags(flags)
, fChain(fStorage.get(), kPreAllocCount) {
fInit = false;
}
* clipped. A simple way to avoid the bug is to always draw the margin
* content last.
*/
- void setDrawingArea(DrawingArea drawingArea);
+ SK_API void setDrawingArea(DrawingArea drawingArea);
// PDF specific methods.
class SampleView : public SkView {
public:
- SampleView() : fRepeatCount(1), fBGColor(SK_ColorWHITE) {
+ SampleView() : fBGColor(SK_ColorWHITE), fRepeatCount(1) {
fUsePipe = false;
}
while ((rec = (MCRec*)iter.next()) != NULL) {
(void)rec->fRegion->op(bounds, SkRegion::kIntersect_Op);
}
- fClipStack.clipDevRect(bounds, SkRegion::kIntersect_Op);
}
return device;
}
void SkCanvas::DrawRect(const SkDraw& draw, const SkPaint& paint,
const SkRect& r, SkScalar textSize) {
- if (paint.getStyle() == SkPaint::kFill_Style) {\r
+ if (paint.getStyle() == SkPaint::kFill_Style) {
draw.fDevice->drawRect(draw, r, paint);
} else {
SkPaint p(paint);
- p.setStrokeWidth(SkScalarMul(textSize, paint.getStrokeWidth()));\r
+ p.setStrokeWidth(SkScalarMul(textSize, paint.getStrokeWidth()));
draw.fDevice->drawRect(draw, r, p);
}
}
fInitialTransform.preConcat(initialTransform);
SkIRect existingClip = SkIRect::MakeWH(this->width(), this->height());
- fExistingClipStack.clipDevRect(existingClip);
fExistingClipRegion.setRect(existingClip);
this->init();
(i >> 8) == (currentRangeEntry.fStart >> 8) &&
glyphToUnicode[i] == (currentRangeEntry.fUnicode +
continuousEntries)) {
- currentRangeEntry.fEnd = i;
+ currentRangeEntry.fEnd = i;
if (i == glyphToUnicode.count() - 1) {
// Last entry is in a range.
bfrangeEntries.push(currentRangeEntry);
}
curr = curr->fNext;
}
- return false;
+ return NULL;
}
static bool valid_uniqueID(uint32_t uniqueID) {
*value = n;
return str;
}
- return false;
+ return NULL;
}
const char* SkParse::FindS32(const char str[], int32_t* value)
SkView::Click* SkView::findClickHandler(SkScalar x, SkScalar y)
{
if (x < 0 || y < 0 || x >= fWidth || y >= fHeight) {
- return false;
+ return NULL;
}
if (this->onSendClickToChildren(x, y)) {