gfx/ycbcr/ycbcr_to_rgb565.h

Tue, 06 Jan 2015 21:39:09 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Tue, 06 Jan 2015 21:39:09 +0100
branch
TOR_BUG_9701
changeset 8
97036ab72558
permissions
-rw-r--r--

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.

     1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
     2 // Use of this source code is governed by a BSD-style license that can be
     3 // found in the LICENSE file.
     4 #ifndef MEDIA_BASE_YCBCR_TO_RGB565_H_
     5 #define MEDIA_BASE_YCBCR_TO_RGB565_H_
     6 #include "yuv_convert.h"
     7 #include "mozilla/arm.h"
     9 // It's currently only worth including this if we have NEON support.
    10 #ifdef MOZILLA_MAY_SUPPORT_NEON
    11 #define HAVE_YCBCR_TO_RGB565 1
    12 #endif
    14 namespace mozilla {
    16 namespace gfx {
    18 #ifdef HAVE_YCBCR_TO_RGB565
    19 // Convert a frame of YUV to 16 bit RGB565.
    20 NS_GFX_(void) ConvertYCbCrToRGB565(const uint8* yplane,
    21                                    const uint8* uplane,
    22                                    const uint8* vplane,
    23                                    uint8* rgbframe,
    24                                    int pic_x,
    25                                    int pic_y,
    26                                    int pic_width,
    27                                    int pic_height,
    28                                    int ystride,
    29                                    int uvstride,
    30                                    int rgbstride,
    31                                    YUVType yuv_type);
    33 // Used to test if we have an accelerated version.
    34 NS_GFX_(bool) IsConvertYCbCrToRGB565Fast(int pic_x,
    35                                          int pic_y,
    36                                          int pic_width,
    37                                          int pic_height,
    38                                          YUVType yuv_type);
    40 // Scale a frame of YUV to 16 bit RGB565.
    41 NS_GFX_(void) ScaleYCbCrToRGB565(const uint8_t *yplane,
    42                                  const uint8_t *uplane,
    43                                  const uint8_t *vplane,
    44                                  uint8_t *rgbframe,
    45                                  int source_x0,
    46                                  int source_y0,
    47                                  int source_width,
    48                                  int source_height,
    49                                  int width,
    50                                  int height,
    51                                  int ystride,
    52                                  int uvstride,
    53                                  int rgbstride,
    54                                  YUVType yuv_type,
    55                                  ScaleFilter filter);
    57 // Used to test if we have an accelerated version.
    58 NS_GFX_(bool) IsScaleYCbCrToRGB565Fast(int source_x0,
    59                                        int source_y0,
    60                                        int source_width,
    61                                        int source_height,
    62                                        int width,
    63                                        int height,
    64                                        YUVType yuv_type,
    65                                        ScaleFilter filter);
    66 #endif // HAVE_YCBCR_TO_RGB565
    68 }  // namespace gfx
    70 }  // namespace mozilla
    72 #endif // MEDIA_BASE_YCBCR_TO_RGB565_H_

mercurial