aboutsummaryrefslogtreecommitdiffhomepage
path: root/tests/CachedDecodingPixelRefTest.cpp
diff options
context:
space:
mode:
authorGravatar reed <reed@google.com>2014-09-03 11:54:58 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-03 11:54:58 -0700
commite5ea500d4714a7d84de2bf913e81be3b65d2de68 (patch)
tree0c94feeb709b17b954f5e97fad463ec9cfc4dc18 /tests/CachedDecodingPixelRefTest.cpp
parent42b0dfeb29e993b7fd247dcecff705d3dd4cf191 (diff)
Hide fields in SkImageInfo
R=rmistry@google.com TBR=bsalomon Author: reed@google.com Review URL: https://codereview.chromium.org/536003002
Diffstat (limited to 'tests/CachedDecodingPixelRefTest.cpp')
-rw-r--r--tests/CachedDecodingPixelRefTest.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/tests/CachedDecodingPixelRefTest.cpp b/tests/CachedDecodingPixelRefTest.cpp
index 7c63a0e925..82789a1bfb 100644
--- a/tests/CachedDecodingPixelRefTest.cpp
+++ b/tests/CachedDecodingPixelRefTest.cpp
@@ -188,28 +188,26 @@ protected:
if ((NULL == info) || (kFailGetInfo_TestType == fType)) {
return false;
}
- info->fWidth = TestImageGenerator::Width();
- info->fHeight = TestImageGenerator::Height();
- info->fColorType = kN32_SkColorType;
- info->fAlphaType = kOpaque_SkAlphaType;
+ *info = SkImageInfo::MakeN32(TestImageGenerator::Width(),
+ TestImageGenerator::Height(),
+ kOpaque_SkAlphaType);
return true;
}
virtual bool onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes,
SkPMColor ctable[], int* ctableCount) SK_OVERRIDE {
REPORTER_ASSERT(fReporter, pixels != NULL);
- size_t minRowBytes
- = static_cast<size_t>(info.fWidth * info.bytesPerPixel());
+ size_t minRowBytes = static_cast<size_t>(info.width() * info.bytesPerPixel());
REPORTER_ASSERT(fReporter, rowBytes >= minRowBytes);
if ((NULL == pixels)
|| (fType != kSucceedGetPixels_TestType)
- || (info.fColorType != kN32_SkColorType)) {
+ || (info.colorType() != kN32_SkColorType)) {
return false;
}
char* bytePtr = static_cast<char*>(pixels);
- for (int y = 0; y < info.fHeight; ++y) {
+ for (int y = 0; y < info.height(); ++y) {
sk_memset32(reinterpret_cast<SkColor*>(bytePtr),
- TestImageGenerator::Color(), info.fWidth);
+ TestImageGenerator::Color(), info.width());
bytePtr += rowBytes;
}
return true;