OLD | NEW |
---|---|
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 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
62 dst->lockPixels(); | 62 dst->lockPixels(); |
63 return true; | 63 return true; |
64 } | 64 } |
65 | 65 |
66 private: | 66 private: |
67 SkImageInfo m_info; | 67 SkImageInfo m_info; |
68 void* m_pixels; | 68 void* m_pixels; |
69 size_t m_rowBytes; | 69 size_t m_rowBytes; |
70 }; | 70 }; |
71 | 71 |
72 static bool updateYUVComponentSizes(const ImageDecoder* decoder, SkISize compone ntSizes[3], ImageDecoder::SizeType sizeType) | 72 static bool updateYUVComponentSizes(ImageDecoder* decoder, SkISize componentSize s[3], ImageDecoder::SizeType sizeType) |
sugoi1
2014/09/11 19:57:41
Oops, adding the "const" here was causing the isSi
Noel Gordon
2014/09/12 01:47:06
Ack.
| |
73 { | 73 { |
74 // canDecodeToYUV() has to be called AFTER isSizeAvailable(), | 74 // canDecodeToYUV() has to be called AFTER isSizeAvailable(), |
75 // otherwise the output color space may not be set in the decoder. | 75 // otherwise the output color space may not be set in the decoder. |
76 if (!decoder->isSizeAvailable() || !decoder->canDecodeToYUV()) | 76 if (!decoder->isSizeAvailable() || !decoder->canDecodeToYUV()) |
77 return false; | 77 return false; |
78 | 78 |
79 IntSize size = decoder->decodedYUVSize(0, sizeType); | 79 IntSize size = decoder->decodedYUVSize(0, sizeType); |
80 componentSizes[0].set(size.width(), size.height()); | 80 componentSizes[0].set(size.width(), size.height()); |
81 size = decoder->decodedYUVSize(1, sizeType); | 81 size = decoder->decodedYUVSize(1, sizeType); |
82 componentSizes[1].set(size.width(), size.height()); | 82 componentSizes[1].set(size.width(), size.height()); |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
331 | 331 |
332 // Setting a dummy ImagePlanes object signals to the decoder that we want to do YUV decoding. | 332 // Setting a dummy ImagePlanes object signals to the decoder that we want to do YUV decoding. |
333 decoder->setData(data, allDataReceived); | 333 decoder->setData(data, allDataReceived); |
334 OwnPtr<ImagePlanes> dummyImagePlanes = adoptPtr(new ImagePlanes); | 334 OwnPtr<ImagePlanes> dummyImagePlanes = adoptPtr(new ImagePlanes); |
335 decoder->setImagePlanes(dummyImagePlanes.release()); | 335 decoder->setImagePlanes(dummyImagePlanes.release()); |
336 | 336 |
337 return updateYUVComponentSizes(decoder.get(), componentSizes, ImageDecoder:: SizeForMemoryAllocation); | 337 return updateYUVComponentSizes(decoder.get(), componentSizes, ImageDecoder:: SizeForMemoryAllocation); |
338 } | 338 } |
339 | 339 |
340 } // namespace blink | 340 } // namespace blink |
OLD | NEW |