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

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

Issue 1497683002: Make platform/graphics to use USING_FAST_MALLOC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 if (src.alphaType() == kOpaque_SkAlphaType && dst.alphaType() == kPremul_SkA lphaType) { 46 if (src.alphaType() == kOpaque_SkAlphaType && dst.alphaType() == kPremul_SkA lphaType) {
47 const SkImageInfo& tmp = src.makeAlphaType(kPremul_SkAlphaType); 47 const SkImageInfo& tmp = src.makeAlphaType(kPremul_SkAlphaType);
48 return tmp == dst; 48 return tmp == dst;
49 } 49 }
50 50
51 return false; 51 return false;
52 } 52 }
53 53
54 // Creates a SkPixelRef such that the memory for pixels is given by an external body. 54 // Creates a SkPixelRef such that the memory for pixels is given by an external body.
55 // This is used to write directly to the memory given by Skia during decoding. 55 // This is used to write directly to the memory given by Skia during decoding.
56 class ImageFrameGenerator::ExternalMemoryAllocator : public SkBitmap::Allocator { 56 class ImageFrameGenerator::ExternalMemoryAllocator final : public SkBitmap::Allo cator {
57 USING_FAST_MALLOC(ExternalMemoryAllocator);
58 WTF_MAKE_NONCOPYABLE(ExternalMemoryAllocator);
57 public: 59 public:
58 ExternalMemoryAllocator(const SkImageInfo& info, void* pixels, size_t rowByt es) 60 ExternalMemoryAllocator(const SkImageInfo& info, void* pixels, size_t rowByt es)
59 : m_info(info) 61 : m_info(info)
60 , m_pixels(pixels) 62 , m_pixels(pixels)
61 , m_rowBytes(rowBytes) 63 , m_rowBytes(rowBytes)
62 { 64 {
63 } 65 }
64 66
65 bool allocPixelRef(SkBitmap* dst, SkColorTable* ctable) override 67 bool allocPixelRef(SkBitmap* dst, SkColorTable* ctable) override
66 { 68 {
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 375
374 // Setting a dummy ImagePlanes object signals to the decoder that we want to do YUV decoding. 376 // Setting a dummy ImagePlanes object signals to the decoder that we want to do YUV decoding.
375 decoder->setData(data, allDataReceived); 377 decoder->setData(data, allDataReceived);
376 OwnPtr<ImagePlanes> dummyImagePlanes = adoptPtr(new ImagePlanes); 378 OwnPtr<ImagePlanes> dummyImagePlanes = adoptPtr(new ImagePlanes);
377 decoder->setImagePlanes(dummyImagePlanes.release()); 379 decoder->setImagePlanes(dummyImagePlanes.release());
378 380
379 return updateYUVComponentSizes(decoder.get(), componentSizes, ImageDecoder:: SizeForMemoryAllocation); 381 return updateYUVComponentSizes(decoder.get(), componentSizes, ImageDecoder:: SizeForMemoryAllocation);
380 } 382 }
381 383
382 } // namespace blink 384 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698