Skia
2DGraphicsLibrary
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkBlitRow.h
1 /*
2  * Copyright 2011 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 
8 #ifndef SkBlitRow_DEFINED
9 #define SkBlitRow_DEFINED
10 
11 #include "SkBitmap.h"
12 #include "SkColor.h"
13 
14 class SkBlitRow {
15 public:
16  enum Flags16 {
22  kDither_Flag = 0x04
23  };
24 
35  typedef void (*Proc16)(uint16_t dst[], const SkPMColor src[], int count,
36  U8CPU alpha, int x, int y);
37 
38  static Proc16 Factory16(unsigned flags);
39 
45  typedef void (*ColorProc16)(uint16_t dst[], SkPMColor src, int count, int x, int y);
46 
47  // Note : we ignore the kGlobalAlpha_Flag setting, but do respect kSrcPixelAlpha_Flag
48  static ColorProc16 ColorFactory16(unsigned flags);
49 
51 
52  enum Flags32 {
53  kGlobalAlpha_Flag32 = 1 << 0,
54  kSrcPixelAlpha_Flag32 = 1 << 1
55  };
56 
63  typedef void (*Proc32)(uint32_t dst[], const SkPMColor src[], int count, U8CPU alpha);
64 
65  static Proc32 Factory32(unsigned flags32);
66 
71  static void Color32(SkPMColor dst[], const SkPMColor src[], int count, SkPMColor color);
72 
79  static Proc32 PlatformProcs32(unsigned flags);
80 
81  static Proc16 PlatformFactory565(unsigned flags);
82  static ColorProc16 PlatformColorFactory565(unsigned flags);
83 
84 private:
85  enum {
86  kFlags16_Mask = 7,
87  kFlags32_Mask = 3
88  };
89 };
90 
91 #endif
void(* ColorProc16)(uint16_t dst[], SkPMColor src, int count, int x, int y)
Function pointer that blends a single src color onto a scaline of dst colors.
Definition: SkBlitRow.h:45
If set, the src colors may have alpha != 255.
Definition: SkBlitRow.h:20
void(* Proc16)(uint16_t dst[], const SkPMColor src[], int count, U8CPU alpha, int x, int y)
Function pointer that reads a scanline of src SkPMColors, and writes a corresponding scanline of 16bi...
Definition: SkBlitRow.h:35
If set, the resulting 16bit colors should be dithered.
Definition: SkBlitRow.h:22
void(* Proc32)(uint32_t dst[], const SkPMColor src[], int count, U8CPU alpha)
Function pointer that blends 32bit colors onto a 32bit destination.
Definition: SkBlitRow.h:63
If set, the alpha parameter will be != 255.
Definition: SkBlitRow.h:18
uint32_t SkPMColor
32 bit ARGB color value, premultiplied.
Definition: SkColor.h:147
static Proc32 PlatformProcs32(unsigned flags)
These static functions are called by the Factory and Factory32 functions, and should return either NU...
Flags16
Definition: SkBlitRow.h:16
static void Color32(SkPMColor dst[], const SkPMColor src[], int count, SkPMColor color)
Blend a single color onto a row of S32 pixels, writing the result into a row of D32 pixels...
unsigned U8CPU
Fast type for unsigned 8 bits.
Definition: SkTypes.h:251
Definition: SkBlitRow.h:14
Types and macros for colors.