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

Side by Side Diff: Source/platform/graphics/ImageFrameGenerator.cpp

Issue 544823003: Re-enabling YUV GPU decoding (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 3 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 | « no previous file | no next file » | 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 * 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
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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698