Address warnings from clang build bot

http://codereview.appspot.com/6506111/



git-svn-id: http://skia.googlecode.com/svn/trunk@5518 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
robertphillips@google.com 2012-09-13 13:25:30 +00:00
parent 1f1543f012
commit 178a267a6c
14 changed files with 27 additions and 29 deletions

View File

@ -125,15 +125,11 @@ static void test_fade(SkCanvas* canvas) {
class RedFilter : public SkDrawFilter {
public:
virtual bool filter(SkCanvas*, SkPaint* p, SkDrawFilter::Type) {
virtual void filter(SkPaint* p, SkDrawFilter::Type) SK_OVERRIDE {
fColor = p->getColor();
if (fColor == SK_ColorRED) {
p->setColor(SK_ColorGREEN);
}
return true;
}
virtual void restore(SkCanvas*, SkPaint* p, SkDrawFilter::Type) {
p->setColor(fColor);
}
private:

View File

@ -34,7 +34,7 @@ class SkDisplayEvent : public SkDisplayable {
};
SkDisplayEvent();
virtual ~SkDisplayEvent();
virtual bool add(SkAnimateMaker& , SkDisplayable* child);
virtual bool add(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE;
virtual bool contains(SkDisplayable*);
virtual SkDisplayable* contains(const SkString& );
#ifdef SK_DEBUG

View File

@ -27,7 +27,7 @@ class SkPost : public SkDisplayable {
};
SkPost();
virtual ~SkPost();
virtual bool add(SkAnimateMaker& , SkDisplayable* child);
virtual bool add(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE;
virtual bool childrenNeedDisposing() const;
virtual void dirty();
#ifdef SK_DUMP_ENABLED

View File

@ -22,7 +22,7 @@ class SkDrawShapePathEffect : public SkDrawPathEffect {
DECLARE_PRIVATE_MEMBER_INFO(DrawShapePathEffect);
SkDrawShapePathEffect();
virtual ~SkDrawShapePathEffect();
virtual bool add(SkAnimateMaker& , SkDisplayable* );
virtual bool add(SkAnimateMaker& , SkDisplayable* ) SK_OVERRIDE;
virtual SkPathEffect* getPathEffect();
protected:
SkDrawable* addPath;
@ -60,7 +60,7 @@ class SkDrawComposePathEffect : public SkDrawPathEffect {
DECLARE_EXTRAS_MEMBER_INFO(SkDrawComposePathEffect);
SkDrawComposePathEffect(SkDisplayTypes );
virtual ~SkDrawComposePathEffect();
virtual bool add(SkAnimateMaker& , SkDisplayable* );
virtual bool add(SkAnimateMaker& , SkDisplayable* ) SK_OVERRIDE;
virtual SkPathEffect* getPathEffect();
virtual bool isPaint() const;
private:

View File

@ -20,7 +20,7 @@ class SkDrawGradient : public SkDrawShader {
DECLARE_PRIVATE_MEMBER_INFO(DrawGradient);
SkDrawGradient();
virtual ~SkDrawGradient();
virtual bool add(SkAnimateMaker& , SkDisplayable* child);
virtual bool add(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE;
#ifdef SK_DUMP_ENABLED
virtual void dumpRest(SkAnimateMaker*);
#endif

View File

@ -19,7 +19,7 @@ public:
DECLARE_MEMBER_INFO(Group);
SkGroup();
virtual ~SkGroup();
virtual bool add(SkAnimateMaker& , SkDisplayable* child);
virtual bool add(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE;
virtual bool contains(SkDisplayable* );
SkGroup* copy();
SkBool copySet(int index);

View File

@ -21,7 +21,7 @@ class SkDrawMatrix : public SkDrawable {
DECLARE_DRAW_MEMBER_INFO(Matrix);
SkDrawMatrix();
virtual ~SkDrawMatrix();
virtual bool add(SkAnimateMaker& , SkDisplayable* child);
virtual bool add(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE;
virtual bool childrenNeedDisposing() const;
virtual void dirty();
virtual bool draw(SkAnimateMaker& );

View File

@ -188,7 +188,7 @@ const SkMemberInfo SkPolyline::fInfo[] = {
DEFINE_GET_MEMBER(SkPolyline);
bool SkPolyline::add(SkAnimateMaker& , SkDisplayable*) const {
bool SkPolyline::add(SkAnimateMaker& , SkDisplayable*) {
return false;
}

View File

@ -19,7 +19,7 @@ class SkDrawPath : public SkBoundable {
DECLARE_DRAW_MEMBER_INFO(Path);
SkDrawPath();
virtual ~SkDrawPath();
virtual bool add(SkAnimateMaker& , SkDisplayable* child);
virtual bool add(SkAnimateMaker& , SkDisplayable* child) SK_OVERRIDE;
bool childHasID() { return SkToBool(fChildHasID); }
virtual bool childrenNeedDisposing() const;
virtual void dirty();
@ -51,7 +51,7 @@ private:
class SkPolyline : public SkDrawPath {
DECLARE_MEMBER_INFO(Polyline);
virtual bool add(SkAnimateMaker& , SkDisplayable*) const;
virtual bool add(SkAnimateMaker& , SkDisplayable*) SK_OVERRIDE;
virtual void onEndElement(SkAnimateMaker& );
protected:
SkTDScalarArray points;

View File

@ -19,13 +19,13 @@ enum {
};
SkPictureRecord::SkPictureRecord(uint32_t flags) :
fBoundingHierarchy(NULL),
fStateTree(NULL),
fFlattenableHeap(HEAP_BLOCK_SIZE),
fMatrices(&fFlattenableHeap),
fPaints(&fFlattenableHeap),
fRegions(&fFlattenableHeap),
fWriter(MIN_WRITER_SIZE),
fBoundingHierarchy(NULL),
fStateTree(NULL),
fRecordFlags(flags) {
#ifdef SK_DEBUG_SIZE
fPointBytes = fRectBytes = fTextBytes = 0;

View File

@ -83,9 +83,9 @@ SkPictureStateTree::Iterator::Iterator(const SkTDArray<void*>& draws, SkCanvas*
: fDraws(draws)
, fCanvas(canvas)
, fCurrentNode(root)
, fPlaybackMatrix(canvas->getTotalMatrix())
, fCurrentMatrix(NULL)
, fPlaybackIndex(0)
, fPlaybackMatrix(canvas->getTotalMatrix())
, fSave(false) {
}

View File

@ -74,20 +74,22 @@ public:
Iterator(const SkTDArray<void*>& draws, SkCanvas* canvas, Node* root);
// The draws this iterator is associated with
const SkTDArray<void*>& fDraws;
// The matrix of the canvas we're playing back into
const SkMatrix fPlaybackMatrix;
// canvas this is playing into (so we can insert saves/restores as necessary)
SkCanvas* fCanvas;
// current state node
Node* fCurrentNode;
// List of nodes whose state we need to apply to reach TargetNode
SkTDArray<Node*> fNodes;
// The matrix of the canvas we're playing back into
const SkMatrix fPlaybackMatrix;
// Cache of current matrix, so we can avoid redundantly setting it
SkMatrix* fCurrentMatrix;
// canvas this is playing into (so we can insert saves/restores as necessary)
SkCanvas* fCanvas;
// current position in the array of draws
int fPlaybackIndex;
// Whether or not we need to do a save next iteration

View File

@ -399,7 +399,7 @@ void SkRTree::validate() {
if (this->isEmpty()) {
return;
}
SkASSERT(fCount == this->validateSubtree(fRoot.fChild.subtree, fRoot.fBounds, true));
SkASSERT(fCount == (size_t)this->validateSubtree(fRoot.fChild.subtree, fRoot.fBounds, true));
#endif
}

View File

@ -46,7 +46,7 @@ static bool verify_query(SkIRect query, DataRect rects[],
SkTDArray<void*>& found) {
SkTDArray<void*> expected;
// manually intersect with every rectangle
for (int i = 0; i < NUM_RECTS; ++i) {
for (size_t i = 0; i < NUM_RECTS; ++i) {
if (SkIRect::IntersectsNoEmptyCheck(query, rects[i].rect)) {
expected.push(rects[i].data);
}
@ -70,7 +70,7 @@ static bool verify_query(SkIRect query, DataRect rects[],
static void runQueries(skiatest::Reporter* reporter, SkRandom& rand, DataRect rects[],
SkRTree& tree) {
for (int i = 0; i < NUM_QUERIES; ++i) {
for (size_t i = 0; i < NUM_QUERIES; ++i) {
SkTDArray<void*> hits;
SkIRect query = random_rect(rand);
tree.search(query, &hits);
@ -102,11 +102,11 @@ static void TestRTree(skiatest::Reporter* reporter) {
++expectedDepthMax;
}
for (int i = 0; i < NUM_ITERATIONS; ++i) {
for (size_t i = 0; i < NUM_ITERATIONS; ++i) {
random_data_rects(rand, rects, NUM_RECTS);
// First try bulk-loaded inserts
for (int i = 0; i < NUM_RECTS; ++i) {
for (size_t i = 0; i < NUM_RECTS; ++i) {
rtree->insert(rects[i].data, rects[i].rect, true);
}
rtree->flushDeferredInserts();
@ -118,7 +118,7 @@ static void TestRTree(skiatest::Reporter* reporter) {
REPORTER_ASSERT(reporter, 0 == rtree->getCount());
// Then try immediate inserts
for (int i = 0; i < NUM_RECTS; ++i) {
for (size_t i = 0; i < NUM_RECTS; ++i) {
rtree->insert(rects[i].data, rects[i].rect);
}
runQueries(reporter, rand, rects, *rtree);