aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-08-26 14:27:59 +0000
committerGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2011-08-26 14:27:59 +0000
commit5f226572b3b6e1a6fea11f5f3c862a47158f66fe (patch)
tree69e7f761c6e7dc7c58d66bdbfbe499d3385be7e7
parentfa510413c18263784dc322f136dec2367dc15f18 (diff)
rolling tree back to its state as of r2169 to see if that fixes Windows buildbots
git-svn-id: http://skia.googlecode.com/svn/trunk@2179 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r--gm/points.cpp10
-rw-r--r--gm/strokerects.cpp4
-rw-r--r--gm/strokes.cpp4
-rw-r--r--gpu/src/GrBinHashKey.h2
-rw-r--r--gpu/src/GrClip.cpp8
-rw-r--r--gpu/src/GrGpuFactory.cpp2
-rw-r--r--include/pdf/SkPDFDevice.h2
-rw-r--r--src/core/SkCanvas.cpp5
-rw-r--r--src/pdf/SkPDFDevice.cpp1
-rw-r--r--src/pdf/SkPDFFont.cpp2
-rw-r--r--src/ports/SkFontHost_linux.cpp2
-rw-r--r--src/utils/SkParse.cpp2
-rw-r--r--src/views/SkView.cpp2
-rw-r--r--whitespace.txt3
14 files changed, 21 insertions, 28 deletions
diff --git a/gm/points.cpp b/gm/points.cpp
index 4aa65975b6..ff535cd24d 100644
--- a/gm/points.cpp
+++ b/gm/points.cpp
@@ -28,14 +28,8 @@ protected:
}
static void fill_pts(SkPoint pts[], size_t n, SkRandom* rand) {
- 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);
- }
+ for (size_t i = 0; i < n; i++)
+ pts[i].set(rand->nextUScalar1() * 640, rand->nextUScalar1() * 480);
}
virtual void onDraw(SkCanvas* canvas) {
diff --git a/gm/strokerects.cpp b/gm/strokerects.cpp
index 44c012029c..29d8cb0ae8 100644
--- a/gm/strokerects.cpp
+++ b/gm/strokerects.cpp
@@ -38,11 +38,9 @@ protected:
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 + woffset, -h/2 + hoffset);
+ r->offset(-w/2 + rand.nextSScalar1(), -h/2 + + rand.nextSScalar1());
}
virtual void onDraw(SkCanvas* canvas) {
diff --git a/gm/strokes.cpp b/gm/strokes.cpp
index d8b21b2f2e..862a517d5f 100644
--- a/gm/strokes.cpp
+++ b/gm/strokes.cpp
@@ -25,11 +25,9 @@ static void rnd_rect(SkRect* r, SkPaint* paint, SkRandom& rand) {
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 + woffset, -h/2 + hoffset);
+ r->offset(-w/2 + rand.nextSScalar1(), -h/2 + + rand.nextSScalar1());
paint->setColor(rand.nextU());
paint->setAlpha(0xFF);
diff --git a/gpu/src/GrBinHashKey.h b/gpu/src/GrBinHashKey.h
index ceaef7aa6f..936eab0c14 100644
--- a/gpu/src/GrBinHashKey.h
+++ b/gpu/src/GrBinHashKey.h
@@ -36,7 +36,7 @@ public:
return *this;
}
- ~GrBinHashKey() {
+ virtual ~GrBinHashKey() {
}
void setKeyData(const uint32_t *data) {
diff --git a/gpu/src/GrClip.cpp b/gpu/src/GrClip.cpp
index ade8c2b971..7ccec261a1 100644
--- a/gpu/src/GrClip.cpp
+++ b/gpu/src/GrClip.cpp
@@ -138,9 +138,13 @@ void GrClip::setFromIterator(GrClipIterator* iter, GrScalar tx, GrScalar ty,
}
}
fConservativeBoundsValid = false;
- if (isectRectValid && rectCount) {
- fConservativeBounds = fList[0].fRect;
+ if (isectRectValid) {
fConservativeBoundsValid = true;
+ if (rectCount > 0) {
+ fConservativeBounds = fList[0].fRect;
+ } else {
+ fConservativeBounds.setEmpty();
+ }
} else if (NULL != conservativeBounds) {
fConservativeBounds = *conservativeBounds;
fConservativeBoundsValid = true;
diff --git a/gpu/src/GrGpuFactory.cpp b/gpu/src/GrGpuFactory.cpp
index 071e67cecb..c3b0242f32 100644
--- a/gpu/src/GrGpuFactory.cpp
+++ b/gpu/src/GrGpuFactory.cpp
@@ -22,7 +22,7 @@
GrGpu* GrGpu::Create(GrEngine engine, GrPlatform3DContext context3D) {
- const GrGLInterface* glInterface = NULL;
+ const GrGLInterface* glInterface;
if (kOpenGL_Shaders_GrEngine == engine ||
kOpenGL_Fixed_GrEngine == engine) {
diff --git a/include/pdf/SkPDFDevice.h b/include/pdf/SkPDFDevice.h
index 395968b5ac..6a150a1772 100644
--- a/include/pdf/SkPDFDevice.h
+++ b/include/pdf/SkPDFDevice.h
@@ -118,7 +118,7 @@ public:
* clipped. A simple way to avoid the bug is to always draw the margin
* content last.
*/
- SK_API void setDrawingArea(DrawingArea drawingArea);
+ void setDrawingArea(DrawingArea drawingArea);
// PDF specific methods.
diff --git a/src/core/SkCanvas.cpp b/src/core/SkCanvas.cpp
index 3bb193bd13..65f34ccce8 100644
--- a/src/core/SkCanvas.cpp
+++ b/src/core/SkCanvas.cpp
@@ -528,6 +528,7 @@ SkDevice* SkCanvas::setDevice(SkDevice* device) {
while ((rec = (MCRec*)iter.next()) != NULL) {
(void)rec->fRegion->op(bounds, SkRegion::kIntersect_Op);
}
+ fClipStack.clipDevRect(bounds, SkRegion::kIntersect_Op);
}
return device;
}
@@ -1383,11 +1384,11 @@ private:
void SkCanvas::DrawRect(const SkDraw& draw, const SkPaint& paint,
const SkRect& r, SkScalar textSize) {
- if (paint.getStyle() == SkPaint::kFill_Style) {
+ if (paint.getStyle() == SkPaint::kFill_Style) {
draw.fDevice->drawRect(draw, r, paint);
} else {
SkPaint p(paint);
- p.setStrokeWidth(SkScalarMul(textSize, paint.getStrokeWidth()));
+ p.setStrokeWidth(SkScalarMul(textSize, paint.getStrokeWidth()));
draw.fDevice->drawRect(draw, r, p);
}
}
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 8cf1eca3b8..e72a6b7603 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -517,6 +517,7 @@ SkPDFDevice::SkPDFDevice(const SkISize& pageSize, const SkISize& contentSize,
fInitialTransform.preConcat(initialTransform);
SkIRect existingClip = SkIRect::MakeWH(this->width(), this->height());
+ fExistingClipStack.clipDevRect(existingClip);
fExistingClipRegion.setRect(existingClip);
this->init();
diff --git a/src/pdf/SkPDFFont.cpp b/src/pdf/SkPDFFont.cpp
index fe55c8d046..989b276d73 100644
--- a/src/pdf/SkPDFFont.cpp
+++ b/src/pdf/SkPDFFont.cpp
@@ -488,7 +488,7 @@ void append_cmap_sections(const SkTDArray<SkUnichar>& glyphToUnicode,
(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);
diff --git a/src/ports/SkFontHost_linux.cpp b/src/ports/SkFontHost_linux.cpp
index b60db0764b..782b93fb25 100644
--- a/src/ports/SkFontHost_linux.cpp
+++ b/src/ports/SkFontHost_linux.cpp
@@ -129,7 +129,7 @@ static SkTypeface* find_from_uniqueID(uint32_t uniqueID) {
}
curr = curr->fNext;
}
- return NULL;
+ return false;
}
static bool valid_uniqueID(uint32_t uniqueID) {
diff --git a/src/utils/SkParse.cpp b/src/utils/SkParse.cpp
index cb265c383f..f93e2ef1b2 100644
--- a/src/utils/SkParse.cpp
+++ b/src/utils/SkParse.cpp
@@ -130,7 +130,7 @@ const char* SkParse::FindHex(const char str[], uint32_t* value)
*value = n;
return str;
}
- return NULL;
+ return false;
}
const char* SkParse::FindS32(const char str[], int32_t* value)
diff --git a/src/views/SkView.cpp b/src/views/SkView.cpp
index 5b154392e8..69dc6fc7f2 100644
--- a/src/views/SkView.cpp
+++ b/src/views/SkView.cpp
@@ -363,7 +363,7 @@ void SkView::Click::copyType(const char type[])
SkView::Click* SkView::findClickHandler(SkScalar x, SkScalar y)
{
if (x < 0 || y < 0 || x >= fWidth || y >= fHeight) {
- return NULL;
+ return false;
}
if (this->onSendClickToChildren(x, y)) {
diff --git a/whitespace.txt b/whitespace.txt
index 6eb4b3122c..45bd404af4 100644
--- a/whitespace.txt
+++ b/whitespace.txt
@@ -17,6 +17,3 @@ You can modify this file to create no-op changelists.
-
-
-