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

Side by Side Diff: include/core/SkScalarCompare.h

Issue 113193004: remove SkScalarCompare type and header (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkCanvas.cpp » ('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
2 /*
3 * Copyright 2006 The Android Open Source Project
4 *
5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file.
7 */
8
9
10 #ifndef SkScalarCompare_DEFINED
11 #define SkScalarCompare_DEFINED
12
13 #include "SkFloatBits.h"
14 #include "SkRect.h"
15
16 /** Skia can spend a lot of time just comparing scalars (e.g. quickReject).
17 When scalar==fixed, this is very fast, and when scalar==hardware-float, this
18 is also reasonable, but if scalar==software-float, then each compare can be
19 a function call and take real time. To account for that, we have the flag
20 SK_SCALAR_SLOW_COMPARES.
21
22 If this is defined, we have a special trick where we quickly convert floats
23 to a 2's compliment form, and then treat them as signed 32bit integers. In
24 this form we lose a few subtlties (e.g. NaNs always comparing false) but
25 we gain the speed of integer compares.
26 */
27
28 #ifdef SK_SCALAR_SLOW_COMPARES
29 typedef int32_t SkScalarCompareType;
30 typedef SkIRect SkRectCompareType;
31 #define SkScalarToCompareType(x) SkScalarAs2sCompliment(x)
32 #else
33 typedef SkScalar SkScalarCompareType;
34 typedef SkRect SkRectCompareType;
35 #define SkScalarToCompareType(x) (x)
36 #endif
37
38 #endif
OLDNEW
« no previous file with comments | « include/core/SkCanvas.h ('k') | src/core/SkCanvas.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698