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

Side by Side Diff: skia/ext/bitmap_platform_device.h

Issue 2011713003: Roll skia to 8cc209111876b7c78b5ec577c9221d8ed5e21024 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 6 months 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
« no previous file with comments | « skia/ext/SkMemory_new_handler.cpp ('k') | skia/ext/bitmap_platform_device_mac.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 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
5 #ifndef SKIA_EXT_BITMAP_PLATFORM_DEVICE_H_
6 #define SKIA_EXT_BITMAP_PLATFORM_DEVICE_H_
7
8 // This file provides an easy way to include the appropriate
9 // BitmapPlatformDevice header file for your platform.
10
11 #if defined(WIN32)
12 #include "skia/ext/bitmap_platform_device_win.h"
13 #elif defined(__APPLE__)
14 #include "skia/ext/bitmap_platform_device_mac.h"
15 #else
16 #include "skia/ext/bitmap_platform_device_skia.h"
17 #endif
18
19 namespace skia {
20 // Returns true if it is unsafe to attempt to allocate an offscreen buffer
21 // given these dimensions.
22 inline bool RasterDeviceTooBigToAllocate(int width, int height) {
23
24 #ifndef SKIA_EXT_RASTER_DEVICE_ALLOCATION_MAX
25 #define SKIA_EXT_RASTER_DEVICE_ALLOCATION_MAX (2 * 256 * 1024 * 1024)
26 #endif
27
28 int bytesPerPixel = 4;
29 int64_t bytes = (int64_t)width * height * bytesPerPixel;
30 return bytes > SKIA_EXT_RASTER_DEVICE_ALLOCATION_MAX;
31 }
32 }
33
34 #endif // SKIA_EXT_BITMAP_PLATFORM_DEVICE_H_
OLDNEW
« no previous file with comments | « skia/ext/SkMemory_new_handler.cpp ('k') | skia/ext/bitmap_platform_device_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698