diff options
| author | Brian Osman <brianosman@google.com> | 2016-10-24 09:24:02 -0400 |
|---|---|---|
| committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-10-24 14:02:27 +0000 |
| commit | 526972ecb5411b84ba2f5e20252f178f9ee2151f (patch) | |
| tree | ef89b6a40fcdf90ae8e0b00b8f7d247510e03656 /samplecode/SampleApp.cpp | |
| parent | 09732a6b0e7c4b087279095762f9d27a4f556aba (diff) | |
Rename all color space factories from New* to Make*
Matches our naming convention for all other types - factories that
return sk_sp (or any type that intelligently manages its own
lifetime) are named Make.
Previous factories are still around, assuming
SK_SUPPORT_LEGACY_COLOR_SPACE_FACTORIES is defined. Enable that
define for Android, etc.
See also: https://codereview.chromium.org/2442053002/
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=3822
Change-Id: Iaea9376490736b494e8ffc820831f052bbe1478d
Reviewed-on: https://skia-review.googlesource.com/3822
Commit-Queue: Brian Osman <brianosman@google.com>
Reviewed-by: Mike Reed <reed@google.com>
Diffstat (limited to 'samplecode/SampleApp.cpp')
| -rw-r--r-- | samplecode/SampleApp.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/samplecode/SampleApp.cpp b/samplecode/SampleApp.cpp index 2194895e0d..20a1969d88 100644 --- a/samplecode/SampleApp.cpp +++ b/samplecode/SampleApp.cpp @@ -334,7 +334,7 @@ public: // Instead, we readPixels into a buffer that we claim is sRGB (readPixels doesn't // do gamut conversion), so these pixels then get thrown directly at the monitor, // giving us the expected results (the output is adapted to the monitor's gamut). - auto srgb = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); + auto srgb = SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); offscreenInfo = offscreenInfo.makeColorSpace(srgb); } SkBitmap bm; @@ -1593,7 +1593,7 @@ static sk_sp<SkColorSpace> getMonitorColorSpace() { const uint8_t* data = CFDataGetBytePtr(dataRef); size_t size = CFDataGetLength(dataRef); - sk_sp<SkColorSpace> colorSpace = SkColorSpace::NewICC(data, size); + sk_sp<SkColorSpace> colorSpace = SkColorSpace::MakeICC(data, size); CFRelease(cs); CFRelease(dataRef); @@ -1618,7 +1618,7 @@ static sk_sp<SkColorSpace> getMonitorColorSpace() { DeleteDC(dc); if (success) { sk_sp<SkData> iccData = SkData::MakeFromFileName(icmPath); - return SkColorSpace::NewICC(iccData->data(), iccData->size()); + return SkColorSpace::MakeICC(iccData->data(), iccData->size()); } } } @@ -1660,13 +1660,13 @@ bool SampleWindow::onEvent(const SkEvent& evt) { sk_sp<SkColorSpace> colorSpace = nullptr; switch (gConfig[selected].fColorSpace) { case kSRGB_OutputColorSpace: - colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); + colorSpace = SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); break; case kMonitor_OutputColorSpace: colorSpace = getMonitorColorSpace(); if (!colorSpace) { // Fallback for platforms / machines where we can't get a monitor profile - colorSpace = SkColorSpace::NewNamed(SkColorSpace::kSRGB_Named); + colorSpace = SkColorSpace::MakeNamed(SkColorSpace::kSRGB_Named); } break; case kLegacy_OutputColorSpace: |
