Use new API instead of the deprecated ones.

This change will allow us to remove the old API in follow up clean up.

BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1728553002

Review URL: https://codereview.chromium.org/1728553002
This commit is contained in:
yujieqin 2016-02-23 06:49:38 -08:00 committed by Commit bot
parent cf16e67f84
commit 2d172ebb29

View File

@ -572,13 +572,13 @@ SkCodec* SkRawCodec::NewFromStream(SkStream* stream) {
if (::piex::IsRaw(&piexStream)) {
::piex::Error error = ::piex::GetPreviewImageData(&piexStream, &imageData);
if (error == ::piex::Error::kOk && imageData.preview_length > 0) {
if (error == ::piex::Error::kOk && imageData.preview.length > 0) {
#if !defined(GOOGLE3)
// transferBuffer() is destructive to the rawStream. Abandon the rawStream after this
// function call.
// FIXME: one may avoid the copy of memoryStream and use the buffered rawStream.
SkMemoryStream* memoryStream =
rawStream->transferBuffer(imageData.preview_offset, imageData.preview_length);
rawStream->transferBuffer(imageData.preview.offset, imageData.preview.length);
return memoryStream ? SkJpegCodec::NewFromStream(memoryStream) : nullptr;
#else
return nullptr;