Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(154)

Side by Side Diff: tests/PixelRefTest.cpp

Issue 806653007: Fix up all the easy virtual ... SK_OVERRIDE cases. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rebase Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/PictureTest.cpp ('k') | tests/QuickRejectTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include "Test.h" 1 #include "Test.h"
2 2
3 #include "SkMallocPixelRef.h" 3 #include "SkMallocPixelRef.h"
4 #include "SkPixelRef.h" 4 #include "SkPixelRef.h"
5 5
6 class TestListener : public SkPixelRef::GenIDChangeListener { 6 class TestListener : public SkPixelRef::GenIDChangeListener {
7 public: 7 public:
8 explicit TestListener(int* ptr) : fPtr(ptr) {} 8 explicit TestListener(int* ptr) : fPtr(ptr) {}
9 virtual void onChange() SK_OVERRIDE { (*fPtr)++; } 9 void onChange() SK_OVERRIDE { (*fPtr)++; }
10 private: 10 private:
11 int* fPtr; 11 int* fPtr;
12 }; 12 };
13 13
14 DEF_TEST(PixelRef_GenIDChange, r) { 14 DEF_TEST(PixelRef_GenIDChange, r) {
15 SkImageInfo info = SkImageInfo::MakeN32Premul(10, 10); 15 SkImageInfo info = SkImageInfo::MakeN32Premul(10, 10);
16 16
17 SkAutoTUnref<SkPixelRef> pixelRef(SkMallocPixelRef::NewAllocate(info, 0, NUL L)); 17 SkAutoTUnref<SkPixelRef> pixelRef(SkMallocPixelRef::NewAllocate(info, 0, NUL L));
18 18
19 // Register a listener. 19 // Register a listener.
(...skipping 17 matching lines...) Expand all
37 REPORTER_ASSERT(r, 0 != pixelRef->getGenerationID()); 37 REPORTER_ASSERT(r, 0 != pixelRef->getGenerationID());
38 pixelRef->addGenIDChangeListener(SkNEW_ARGS(TestListener, (&count))); 38 pixelRef->addGenIDChangeListener(SkNEW_ARGS(TestListener, (&count)));
39 pixelRef->notifyPixelsChanged(); 39 pixelRef->notifyPixelsChanged();
40 REPORTER_ASSERT(r, 1 == count); 40 REPORTER_ASSERT(r, 1 == count);
41 41
42 // Quick check that NULL is safe. 42 // Quick check that NULL is safe.
43 REPORTER_ASSERT(r, 0 != pixelRef->getGenerationID()); 43 REPORTER_ASSERT(r, 0 != pixelRef->getGenerationID());
44 pixelRef->addGenIDChangeListener(NULL); 44 pixelRef->addGenIDChangeListener(NULL);
45 pixelRef->notifyPixelsChanged(); 45 pixelRef->notifyPixelsChanged();
46 } 46 }
OLDNEW
« no previous file with comments | « tests/PictureTest.cpp ('k') | tests/QuickRejectTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698