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 { class RedFilter : public SkDrawFilter {
public: public:
virtual bool filter(SkCanvas*, SkPaint* p, SkDrawFilter::Type) { virtual void filter(SkPaint* p, SkDrawFilter::Type) SK_OVERRIDE {
fColor = p->getColor(); fColor = p->getColor();
if (fColor == SK_ColorRED) { if (fColor == SK_ColorRED) {
p->setColor(SK_ColorGREEN); p->setColor(SK_ColorGREEN);
} }
return true;
}
virtual void restore(SkCanvas*, SkPaint* p, SkDrawFilter::Type) {
p->setColor(fColor);
} }
private: private:

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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