diff options
author | tomhudson <tomhudson@google.com> | 2016-02-10 11:51:59 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-02-10 19:53:19 +0000 |
commit | 3a6a4e5e8f1b4fd564e8b50931dc82ed75d180cc (patch) | |
tree | f2d7cbe54351b9f0b403b5734de8421c6126984c /skia/ext | |
parent | 8c97805625a945d52bb8c2a024a2895c6703ca1c (diff) | |
download | chromium_src-3a6a4e5e8f1b4fd564e8b50931dc82ed75d180cc.zip chromium_src-3a6a4e5e8f1b4fd564e8b50931dc82ed75d180cc.tar.gz chromium_src-3a6a4e5e8f1b4fd564e8b50931dc82ed75d180cc.tar.bz2 |
Move RasterDeviceTooBigToAllocate to caller
RasterDeviceTooBigToAllocate() is a utility function only used
from a single cc file; move it out of the header into that file.
R=fmalita@chromium.org
Review URL: https://codereview.chromium.org/1687933002
Cr-Commit-Position: refs/heads/master@{#374705}
Diffstat (limited to 'skia/ext')
-rw-r--r-- | skia/ext/bitmap_platform_device.h | 15 | ||||
-rw-r--r-- | skia/ext/bitmap_platform_device_mac.cc | 13 |
2 files changed, 13 insertions, 15 deletions
diff --git a/skia/ext/bitmap_platform_device.h b/skia/ext/bitmap_platform_device.h index 11acd95..1ca5f7e 100644 --- a/skia/ext/bitmap_platform_device.h +++ b/skia/ext/bitmap_platform_device.h @@ -20,19 +20,4 @@ #include "skia/ext/bitmap_platform_device_skia.h" #endif -namespace skia { - // Returns true if it is unsafe to attempt to allocate an offscreen buffer - // given these dimensions. - inline bool RasterDeviceTooBigToAllocate(int width, int height) { - -#ifndef SKIA_EXT_RASTER_DEVICE_ALLOCATION_MAX -#define SKIA_EXT_RASTER_DEVICE_ALLOCATION_MAX (2 * 256 * 1024 * 1024) -#endif - - int bytesPerPixel = 4; - int64_t bytes = (int64_t)width * height * bytesPerPixel; - return bytes > SKIA_EXT_RASTER_DEVICE_ALLOCATION_MAX; - } -} - #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_H_ diff --git a/skia/ext/bitmap_platform_device_mac.cc b/skia/ext/bitmap_platform_device_mac.cc index e2b2c02..d46efdd 100644 --- a/skia/ext/bitmap_platform_device_mac.cc +++ b/skia/ext/bitmap_platform_device_mac.cc @@ -23,6 +23,19 @@ namespace skia { namespace { +// Returns true if it is unsafe to attempt to allocate an offscreen buffer +// given these dimensions. +bool RasterDeviceTooBigToAllocate(int width, int height) { + +#ifndef SKIA_EXT_RASTER_DEVICE_ALLOCATION_MAX +#define SKIA_EXT_RASTER_DEVICE_ALLOCATION_MAX (2 * 256 * 1024 * 1024) +#endif + + int bytesPerPixel = 4; + int64_t bytes = (int64_t)width * height * bytesPerPixel; + return bytes > SKIA_EXT_RASTER_DEVICE_ALLOCATION_MAX; +} + static CGContextRef CGContextForData(void* data, int width, int height) { #define HAS_ARGB_SHIFTS(a, r, g, b) \ (SK_A32_SHIFT == (a) && SK_R32_SHIFT == (r) \ |