Tue, 06 Jan 2015 21:39:09 +0100
Conditionally force memory storage according to privacy.thirdparty.isolate;
This solves Tor bug #9701, complying with disk avoidance documented in
https://www.torproject.org/projects/torbrowser/design/#disk-avoidance.
michael@0 | 1 | // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
michael@0 | 2 | // Use of this source code is governed by a BSD-style license that can be |
michael@0 | 3 | // found in the LICENSE file. |
michael@0 | 4 | #ifndef MEDIA_BASE_YCBCR_TO_RGB565_H_ |
michael@0 | 5 | #define MEDIA_BASE_YCBCR_TO_RGB565_H_ |
michael@0 | 6 | #include "yuv_convert.h" |
michael@0 | 7 | #include "mozilla/arm.h" |
michael@0 | 8 | |
michael@0 | 9 | // It's currently only worth including this if we have NEON support. |
michael@0 | 10 | #ifdef MOZILLA_MAY_SUPPORT_NEON |
michael@0 | 11 | #define HAVE_YCBCR_TO_RGB565 1 |
michael@0 | 12 | #endif |
michael@0 | 13 | |
michael@0 | 14 | namespace mozilla { |
michael@0 | 15 | |
michael@0 | 16 | namespace gfx { |
michael@0 | 17 | |
michael@0 | 18 | #ifdef HAVE_YCBCR_TO_RGB565 |
michael@0 | 19 | // Convert a frame of YUV to 16 bit RGB565. |
michael@0 | 20 | NS_GFX_(void) ConvertYCbCrToRGB565(const uint8* yplane, |
michael@0 | 21 | const uint8* uplane, |
michael@0 | 22 | const uint8* vplane, |
michael@0 | 23 | uint8* rgbframe, |
michael@0 | 24 | int pic_x, |
michael@0 | 25 | int pic_y, |
michael@0 | 26 | int pic_width, |
michael@0 | 27 | int pic_height, |
michael@0 | 28 | int ystride, |
michael@0 | 29 | int uvstride, |
michael@0 | 30 | int rgbstride, |
michael@0 | 31 | YUVType yuv_type); |
michael@0 | 32 | |
michael@0 | 33 | // Used to test if we have an accelerated version. |
michael@0 | 34 | NS_GFX_(bool) IsConvertYCbCrToRGB565Fast(int pic_x, |
michael@0 | 35 | int pic_y, |
michael@0 | 36 | int pic_width, |
michael@0 | 37 | int pic_height, |
michael@0 | 38 | YUVType yuv_type); |
michael@0 | 39 | |
michael@0 | 40 | // Scale a frame of YUV to 16 bit RGB565. |
michael@0 | 41 | NS_GFX_(void) ScaleYCbCrToRGB565(const uint8_t *yplane, |
michael@0 | 42 | const uint8_t *uplane, |
michael@0 | 43 | const uint8_t *vplane, |
michael@0 | 44 | uint8_t *rgbframe, |
michael@0 | 45 | int source_x0, |
michael@0 | 46 | int source_y0, |
michael@0 | 47 | int source_width, |
michael@0 | 48 | int source_height, |
michael@0 | 49 | int width, |
michael@0 | 50 | int height, |
michael@0 | 51 | int ystride, |
michael@0 | 52 | int uvstride, |
michael@0 | 53 | int rgbstride, |
michael@0 | 54 | YUVType yuv_type, |
michael@0 | 55 | ScaleFilter filter); |
michael@0 | 56 | |
michael@0 | 57 | // Used to test if we have an accelerated version. |
michael@0 | 58 | NS_GFX_(bool) IsScaleYCbCrToRGB565Fast(int source_x0, |
michael@0 | 59 | int source_y0, |
michael@0 | 60 | int source_width, |
michael@0 | 61 | int source_height, |
michael@0 | 62 | int width, |
michael@0 | 63 | int height, |
michael@0 | 64 | YUVType yuv_type, |
michael@0 | 65 | ScaleFilter filter); |
michael@0 | 66 | #endif // HAVE_YCBCR_TO_RGB565 |
michael@0 | 67 | |
michael@0 | 68 | } // namespace gfx |
michael@0 | 69 | |
michael@0 | 70 | } // namespace mozilla |
michael@0 | 71 | |
michael@0 | 72 | #endif // MEDIA_BASE_YCBCR_TO_RGB565_H_ |