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.
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 #ifndef MOZILLA_GFX_SCALE_H_
6 #define MOZILLA_GFX_SCALE_H_
8 #include "Types.h"
10 namespace mozilla {
11 namespace gfx {
13 /**
14 * Scale an image using a high-quality filter.
15 *
16 * Synchronously scales an image and writes the output to the destination in
17 * 32-bit format. The destination must be pre-allocated by the caller.
18 *
19 * Returns true if scaling was successful, and false otherwise. Currently, this
20 * function is implemented using Skia. If Skia is not enabled when building,
21 * calling this function will always return false.
22 *
23 * IMPLEMTATION NOTES:
24 * This API is not currently easily hardware acceleratable. A better API might
25 * take a SourceSurface and return a SourceSurface; the Direct2D backend, for
26 * example, could simply set a status bit on a copy of the image, and use
27 * Direct2D's high-quality scaler at draw time.
28 */
29 GFX2D_API bool Scale(uint8_t* srcData, int32_t srcWidth, int32_t srcHeight, int32_t srcStride,
30 uint8_t* dstData, int32_t dstWidth, int32_t dstHeight, int32_t dstStride,
31 SurfaceFormat format);
33 }
34 }
36 #endif /* MOZILLA_GFX_BLUR_H_ */