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

Side by Side Diff: sky/engine/platform/graphics/DecodingImageGenerator.cpp

Issue 951673002: Revert "Pull chromium at 2c3ffb2355a27c32f45e508ef861416b820c823b" (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « sky/engine/platform/graphics/DecodingImageGenerator.h ('k') | testing/android/native_test.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2012 Google Inc. All rights reserved. 2 * Copyright (C) 2012 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 return SkData::NewWithCopy(buffer->data(), buffer->size()); 58 return SkData::NewWithCopy(buffer->data(), buffer->size());
59 return 0; 59 return 0;
60 } 60 }
61 61
62 bool DecodingImageGenerator::onGetInfo(SkImageInfo* info) 62 bool DecodingImageGenerator::onGetInfo(SkImageInfo* info)
63 { 63 {
64 *info = m_imageInfo; 64 *info = m_imageInfo;
65 return true; 65 return true;
66 } 66 }
67 67
68 SkImageGenerator::Result DecodingImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, SkPMColor ctable[], int* ctableCount) 68 bool DecodingImageGenerator::onGetPixels(const SkImageInfo& info, void* pixels, size_t rowBytes, SkPMColor ctable[], int* ctableCount)
69 { 69 {
70 TRACE_EVENT1("blink", "DecodingImageGenerator::getPixels", "index", static_c ast<int>(m_frameIndex)); 70 TRACE_EVENT1("blink", "DecodingImageGenerator::getPixels", "index", static_c ast<int>(m_frameIndex));
71 71
72 // Implementation doesn't support scaling yet so make sure we're not given a different size. 72 // Implementation doesn't support scaling yet so make sure we're not given a different size.
73 if (info.width() != m_imageInfo.width() || info.height() != m_imageInfo.heig ht() || info.colorType() != m_imageInfo.colorType()) { 73 if (info.width() != m_imageInfo.width() || info.height() != m_imageInfo.heig ht() || info.colorType() != m_imageInfo.colorType()) {
74 // ImageFrame may have changed the owning SkBitmap to kOpaque_SkAlphaTyp e after sniffing the encoded data, so if we see a request 74 // ImageFrame may have changed the owning SkBitmap to kOpaque_SkAlphaTyp e after sniffing the encoded data, so if we see a request
75 // for opaque, that is ok even if our initial alphatype was not opaque. 75 // for opaque, that is ok even if our initial alphatype was not opaque.
76 return Result::kInvalidScale; 76 return false;
77 } 77 }
78 78
79 bool decoded = m_frameGenerator->decodeAndScale(m_imageInfo, m_frameIndex, p ixels, rowBytes); 79 bool decoded = m_frameGenerator->decodeAndScale(m_imageInfo, m_frameIndex, p ixels, rowBytes);
80 return decoded ? Result::kSuccess : Result::kInvalidInput; 80 return decoded;
81 } 81 }
82 82
83 bool DecodingImageGenerator::onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3]) 83 bool DecodingImageGenerator::onGetYUV8Planes(SkISize sizes[3], void* planes[3], size_t rowBytes[3])
84 { 84 {
85 if (!planes || !planes[0]) { 85 if (!planes || !planes[0]) {
86 return m_frameGenerator->getYUVComponentSizes(sizes); 86 return m_frameGenerator->getYUVComponentSizes(sizes);
87 } 87 }
88 88
89 TRACE_EVENT0("blink", "DecodingImageGenerator::onGetYUV8Planes"); 89 TRACE_EVENT0("blink", "DecodingImageGenerator::onGetYUV8Planes");
90 bool decoded = m_frameGenerator->decodeToYUV(planes, rowBytes); 90 bool decoded = m_frameGenerator->decodeToYUV(planes, rowBytes);
91 return decoded; 91 return decoded;
92 } 92 }
93 93
94 } // namespace blink 94 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/platform/graphics/DecodingImageGenerator.h ('k') | testing/android/native_test.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698