Fix undefined GrIORef test method on Chrome win bot
Change-Id: Ifc3d7e285a4b1a0b370ec79963127490bd7b1a84 Reviewed-on: https://skia-review.googlesource.com/6896 Reviewed-by: Robert Phillips <robertphillips@google.com> Commit-Queue: Brian Salomon <bsalomon@google.com>
This commit is contained in:
parent
6ff51aedda
commit
f046e15347
@ -75,8 +75,6 @@ public:
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void testingOnly_getCounts(int* refCnt, int* readCnt, int* writeCnt) const;
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
GrIORef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0) { }
|
GrIORef() : fRefCnt(1), fPendingReads(0), fPendingWrites(0) { }
|
||||||
|
|
||||||
@ -96,6 +94,9 @@ protected:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
friend class GrIORefProxy; // needs to forward on wrapped IO calls
|
friend class GrIORefProxy; // needs to forward on wrapped IO calls
|
||||||
|
// This is for a unit test.
|
||||||
|
template <typename T>
|
||||||
|
friend void testingOnly_getIORefCnts(const T*, int* refCnt, int* readCnt, int* writeCnt);
|
||||||
|
|
||||||
void addPendingRead() const {
|
void addPendingRead() const {
|
||||||
this->validate();
|
this->validate();
|
||||||
|
@ -109,11 +109,11 @@ private:
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename D>
|
template <typename T>
|
||||||
inline void GrIORef<D>::testingOnly_getCounts(int* refCnt, int* readCnt, int* writeCnt) const {
|
inline void testingOnly_getIORefCnts(const T* resource, int* refCnt, int* readCnt, int* writeCnt) {
|
||||||
*refCnt = fRefCnt;
|
*refCnt = resource->fRefCnt;
|
||||||
*readCnt = fPendingReads;
|
*readCnt = resource->fPendingReads;
|
||||||
*writeCnt = fPendingWrites;
|
*writeCnt = resource->fPendingWrites;
|
||||||
}
|
}
|
||||||
|
|
||||||
DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) {
|
DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) {
|
||||||
@ -168,30 +168,30 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) {
|
|||||||
}
|
}
|
||||||
int refCnt, readCnt, writeCnt;
|
int refCnt, readCnt, writeCnt;
|
||||||
|
|
||||||
texture1->testingOnly_getCounts(&refCnt, &readCnt, &writeCnt);
|
testingOnly_getIORefCnts(texture1.get(), &refCnt, &readCnt, &writeCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == refCnt);
|
REPORTER_ASSERT(reporter, 1 == refCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == readCnt);
|
REPORTER_ASSERT(reporter, 1 == readCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
||||||
|
|
||||||
if (texelBufferSupport) {
|
if (texelBufferSupport) {
|
||||||
buffer->testingOnly_getCounts(&refCnt, &readCnt, &writeCnt);
|
testingOnly_getIORefCnts(buffer.get(), &refCnt, &readCnt, &writeCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == refCnt);
|
REPORTER_ASSERT(reporter, 1 == refCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == readCnt);
|
REPORTER_ASSERT(reporter, 1 == readCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (imageLoadStoreSupport) {
|
if (imageLoadStoreSupport) {
|
||||||
texture2->testingOnly_getCounts(&refCnt, &readCnt, &writeCnt);
|
testingOnly_getIORefCnts(texture2.get(), &refCnt, &readCnt, &writeCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == refCnt);
|
REPORTER_ASSERT(reporter, 1 == refCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == readCnt);
|
REPORTER_ASSERT(reporter, 1 == readCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
||||||
|
|
||||||
texture3->testingOnly_getCounts(&refCnt, &readCnt, &writeCnt);
|
testingOnly_getIORefCnts(texture3.get(), &refCnt, &readCnt, &writeCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == refCnt);
|
REPORTER_ASSERT(reporter, 1 == refCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == readCnt);
|
REPORTER_ASSERT(reporter, 0 == readCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == writeCnt);
|
REPORTER_ASSERT(reporter, 1 == writeCnt);
|
||||||
|
|
||||||
texture4->testingOnly_getCounts(&refCnt, &readCnt, &writeCnt);
|
testingOnly_getIORefCnts(texture4.get(), &refCnt, &readCnt, &writeCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == refCnt);
|
REPORTER_ASSERT(reporter, 1 == refCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == readCnt);
|
REPORTER_ASSERT(reporter, 1 == readCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == writeCnt);
|
REPORTER_ASSERT(reporter, 1 == writeCnt);
|
||||||
@ -199,30 +199,30 @@ DEF_GPUTEST_FOR_ALL_CONTEXTS(ProcessorRefTest, reporter, ctxInfo) {
|
|||||||
|
|
||||||
context->flush();
|
context->flush();
|
||||||
|
|
||||||
texture1->testingOnly_getCounts(&refCnt, &readCnt, &writeCnt);
|
testingOnly_getIORefCnts(texture1.get(), &refCnt, &readCnt, &writeCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == refCnt);
|
REPORTER_ASSERT(reporter, 1 == refCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == readCnt);
|
REPORTER_ASSERT(reporter, 0 == readCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
||||||
|
|
||||||
if (texelBufferSupport) {
|
if (texelBufferSupport) {
|
||||||
buffer->testingOnly_getCounts(&refCnt, &readCnt, &writeCnt);
|
testingOnly_getIORefCnts(buffer.get(), &refCnt, &readCnt, &writeCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == refCnt);
|
REPORTER_ASSERT(reporter, 1 == refCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == readCnt);
|
REPORTER_ASSERT(reporter, 0 == readCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (texelBufferSupport) {
|
if (texelBufferSupport) {
|
||||||
texture2->testingOnly_getCounts(&refCnt, &readCnt, &writeCnt);
|
testingOnly_getIORefCnts(texture2.get(), &refCnt, &readCnt, &writeCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == refCnt);
|
REPORTER_ASSERT(reporter, 1 == refCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == readCnt);
|
REPORTER_ASSERT(reporter, 0 == readCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
||||||
|
|
||||||
texture3->testingOnly_getCounts(&refCnt, &readCnt, &writeCnt);
|
testingOnly_getIORefCnts(texture3.get(), &refCnt, &readCnt, &writeCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == refCnt);
|
REPORTER_ASSERT(reporter, 1 == refCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == readCnt);
|
REPORTER_ASSERT(reporter, 0 == readCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
||||||
|
|
||||||
texture4->testingOnly_getCounts(&refCnt, &readCnt, &writeCnt);
|
testingOnly_getIORefCnts(texture4.get(), &refCnt, &readCnt, &writeCnt);
|
||||||
REPORTER_ASSERT(reporter, 1 == refCnt);
|
REPORTER_ASSERT(reporter, 1 == refCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == readCnt);
|
REPORTER_ASSERT(reporter, 0 == readCnt);
|
||||||
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
REPORTER_ASSERT(reporter, 0 == writeCnt);
|
||||||
|
Loading…
Reference in New Issue
Block a user