Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Typedefs | Functions | Variables
ShipSlide.cpp File Reference
#include "include/core/SkCanvas.h"
#include "include/core/SkFont.h"
#include "include/core/SkRSXform.h"
#include "include/core/SkSurface.h"
#include "src/core/SkPaintPriv.h"
#include "tools/DecodeUtils.h"
#include "tools/Resources.h"
#include "tools/timer/Timer.h"
#include "tools/viewer/Slide.h"
#include <stdio.h>

Go to the source code of this file.

Classes

class  DrawShipSlide
 

Typedefs

typedef void(* DrawAtlasProc) (SkCanvas *, SkImage *, const SkRSXform[], const SkRect[], const SkColor[], int, const SkRect *, const SkSamplingOptions &, const SkPaint *)
 

Functions

static void draw_atlas (SkCanvas *canvas, SkImage *atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, const SkRect *cull, const SkSamplingOptions &sampling, const SkPaint *paint)
 
static void draw_atlas_sim (SkCanvas *canvas, SkImage *atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, const SkRect *cull, const SkSamplingOptions &sampling, const SkPaint *paint)
 

Variables

static const int kGrid = 100
 
static const int kWidth = 960
 
static const int kHeight = 640
 

Typedef Documentation

◆ DrawAtlasProc

typedef void(* DrawAtlasProc) (SkCanvas *, SkImage *, const SkRSXform[], const SkRect[], const SkColor[], int, const SkRect *, const SkSamplingOptions &, const SkPaint *)

Definition at line 24 of file ShipSlide.cpp.

Function Documentation

◆ draw_atlas()

static void draw_atlas ( SkCanvas canvas,
SkImage atlas,
const SkRSXform  xform[],
const SkRect  tex[],
const SkColor  colors[],
int  count,
const SkRect cull,
const SkSamplingOptions sampling,
const SkPaint paint 
)
static

Definition at line 27 of file ShipSlide.cpp.

29 {
30 canvas->drawAtlas(atlas, xform, tex, colors, count, SkBlendMode::kModulate, sampling,
31 cull, paint);
32}
int count
@ kModulate
r = s*d
void drawAtlas(const SkImage *atlas, const SkRSXform xform[], const SkRect tex[], const SkColor colors[], int count, SkBlendMode mode, const SkSamplingOptions &sampling, const SkRect *cullRect, const SkPaint *paint)
const Paint & paint

◆ draw_atlas_sim()

static void draw_atlas_sim ( SkCanvas canvas,
SkImage atlas,
const SkRSXform  xform[],
const SkRect  tex[],
const SkColor  colors[],
int  count,
const SkRect cull,
const SkSamplingOptions sampling,
const SkPaint paint 
)
static

Definition at line 34 of file ShipSlide.cpp.

36 {
37 for (int i = 0; i < count; ++i) {
39 matrix.setRSXform(xform[i]);
40
41 canvas->save();
42 canvas->concat(matrix);
43 canvas->drawImageRect(atlas, tex[i], tex[i].makeOffset(-tex[i].x(), -tex[i].y()),
45 canvas->restore();
46 }
47}
void restore()
Definition SkCanvas.cpp:465
@ kFast_SrcRectConstraint
sample outside bounds; faster
Definition SkCanvas.h:1543
void drawImageRect(const SkImage *, const SkRect &src, const SkRect &dst, const SkSamplingOptions &, const SkPaint *, SrcRectConstraint)
int save()
Definition SkCanvas.cpp:451
void concat(const SkMatrix &matrix)
double y
double x
unsigned useCenter Optional< SkMatrix > matrix
Definition SkRecords.h:258

Variable Documentation

◆ kGrid

const int kGrid = 100
static

Definition at line 20 of file ShipSlide.cpp.

◆ kHeight

const int kHeight = 640
static

Definition at line 22 of file ShipSlide.cpp.

◆ kWidth

const int kWidth = 960
static

Definition at line 21 of file ShipSlide.cpp.