Flutter Engine
The Flutter Engine
Classes | Functions
main.mm File Reference
#include "tools/skottie_ios_app/SkMetalViewBridge.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkColor.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkPaint.h"
#include "include/core/SkSurface.h"
#include "include/effects/SkGradientShader.h"
#include "include/gpu/GrBackendSurface.h"
#include "include/gpu/GrDirectContext.h"
#include "include/gpu/ganesh/SkSurfaceGanesh.h"
#include "include/gpu/ganesh/mtl/GrMtlTypes.h"
#include "src/base/SkTime.h"
#import <Metal/Metal.h>
#import <MetalKit/MetalKit.h>
#import <UIKit/UIKit.h>

Go to the source code of this file.

Classes

class  AppViewDelegate
 
class  AppViewController
 
class  AppDelegate
 

Functions

static void config_paint (SkPaint *paint)
 
static void draw_example (SkSurface *surface, const SkPaint &paint, double rotation)
 
int main (int argc, char *argv[])
 

Function Documentation

◆ config_paint()

static void config_paint ( SkPaint paint)
static

Definition at line 29 of file main.mm.

29 {
30 if (!paint->getShader()) {
32 const SkPoint points[2] = {{0, -1024}, {0, 1024}};
33 paint->setShader(SkGradientShader::MakeLinear(points, colors, nullptr, nullptr, 2,
34 SkTileMode::kClamp, 0, nullptr));
35 }
36}
static const int points[]
static sk_sp< SkShader > MakeLinear(const SkPoint pts[2], const SkColor colors[], const SkScalar pos[], int count, SkTileMode mode, uint32_t flags=0, const SkMatrix *localMatrix=nullptr)
const Paint & paint
Definition: color_source.cc:38
constexpr SkColor4f kWhite
Definition: SkColor.h:439
constexpr SkColor4f kBlack
Definition: SkColor.h:435
PODArray< SkColor > colors
Definition: SkRecords.h:276

◆ draw_example()

static void draw_example ( SkSurface surface,
const SkPaint paint,
double  rotation 
)
static

Definition at line 38 of file main.mm.

38 {
39 SkCanvas* canvas = surface->getCanvas();
40 canvas->translate(surface->width() * 0.5f, surface->height() * 0.5f);
41 canvas->rotate(rotation);
42 canvas->drawPaint(paint);
43}
void translate(SkScalar dx, SkScalar dy)
Definition: SkCanvas.cpp:1278
void drawPaint(const SkPaint &paint)
Definition: SkCanvas.cpp:1668
void rotate(SkScalar degrees)
Definition: SkCanvas.cpp:1300
VkSurfaceKHR surface
Definition: main.cc:49

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 145 of file main.mm.

145 {
146 @autoreleasepool {
147 return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
148 }
149}
char ** argv
Definition: library.h:9