Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Functions | Variables
animated_image_orientation.cpp File Reference
#include "gm/gm.h"
#include "include/android/SkAnimatedImage.h"
#include "include/codec/SkAndroidCodec.h"
#include "include/codec/SkCodec.h"
#include "include/core/SkBlendMode.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkData.h"
#include "include/core/SkImage.h"
#include "include/core/SkPathBuilder.h"
#include "include/core/SkPathTypes.h"
#include "include/core/SkPicture.h"
#include "include/core/SkPictureRecorder.h"
#include "include/core/SkRRect.h"
#include "tools/Resources.h"

Go to the source code of this file.

Classes

class  AnimatedImageGM
 

Functions

static sk_sp< SkPicturepost_processor (const SkRect &bounds)
 
 DEF_GM (return new AnimatedImageGM("images/stoplight_h.webp", "stoplight", 2, SkIRect::MakeLTRB(5, 6, 11, 29));) DEF_GM(return new AnimatedImageGM("images/flightAnim.gif"
 

Variables

 flight
 

Function Documentation

◆ DEF_GM()

DEF_GM ( return new AnimatedImageGM("images/stoplight_h.webp", "stoplight", 2, SkIRect::MakeLTRB(5, 6, 11, 29));   )
new

◆ post_processor()

static sk_sp< SkPicture > post_processor ( const SkRect bounds)
static

Definition at line 23 of file animated_image_orientation.cpp.

23 {
24 int radius = (bounds.width() + bounds.height()) / 6;
25 SkPathBuilder pathBuilder;
27 .addRRect(SkRRect::MakeRectXY(bounds, radius, radius));
28
30 paint.setAntiAlias(true);
31 paint.setColor(SK_ColorTRANSPARENT);
32 paint.setBlendMode(SkBlendMode::kSrc);
33
34 SkPictureRecorder recorder;
35 auto* canvas = recorder.beginRecording(bounds);
36 canvas->drawPath(pathBuilder.detach(), paint);
37 return recorder.finishRecordingAsPicture();
38}
constexpr SkColor SK_ColorTRANSPARENT
Definition SkColor.h:99
void drawPath(const SkPath &path, const SkPaint &paint)
SkPathBuilder & setFillType(SkPathFillType ft)
SkPathBuilder & addRRect(const SkRRect &, SkPathDirection, unsigned startIndex)
SkCanvas * beginRecording(const SkRect &bounds, sk_sp< SkBBoxHierarchy > bbh)
sk_sp< SkPicture > finishRecordingAsPicture()
static SkRRect MakeRectXY(const SkRect &rect, SkScalar xRad, SkScalar yRad)
Definition SkRRect.h:180
const Paint & paint
Optional< SkRect > bounds
Definition SkRecords.h:189

Variable Documentation

◆ flight

flight

Definition at line 161 of file animated_image_orientation.cpp.