Flutter Engine
The Flutter Engine
Functions
SkDrawable.cpp File Reference
#include "include/core/SkDrawable.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPicture.h"
#include "include/core/SkPictureRecorder.h"
#include "include/core/SkRect.h"
#include "include/core/SkRefCnt.h"
#include "include/core/SkScalar.h"
#include <atomic>
#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Functions

static int32_t next_generation_id ()
 
static void draw_bbox (SkCanvas *canvas, const SkRect &r)
 

Function Documentation

◆ draw_bbox()

static void draw_bbox ( SkCanvas canvas,
const SkRect r 
)
static

Definition at line 34 of file SkDrawable.cpp.

34 {
37 paint.setColor(0xFFFF7088);
38 canvas->drawRect(r, paint);
39 canvas->drawLine(r.left(), r.top(), r.right(), r.bottom(), paint);
40 canvas->drawLine(r.left(), r.bottom(), r.right(), r.top(), paint);
41}
void drawRect(const SkRect &rect, const SkPaint &paint)
Definition: SkCanvas.cpp:1673
void drawLine(SkScalar x0, SkScalar y0, SkScalar x1, SkScalar y1, const SkPaint &paint)
Definition: SkCanvas.cpp:2700
@ kStroke_Style
set to stroke geometry
Definition: SkPaint.h:194
const Paint & paint
Definition: color_source.cc:38
constexpr float left() const
Definition: SkRect.h:734
constexpr float top() const
Definition: SkRect.h:741
constexpr float right() const
Definition: SkRect.h:748
constexpr float bottom() const
Definition: SkRect.h:755

◆ next_generation_id()

static int32_t next_generation_id ( )
static

Definition at line 22 of file SkDrawable.cpp.

22 {
23 static std::atomic<int32_t> nextID{1};
24
25 int32_t id;
26 do {
27 id = nextID.fetch_add(1, std::memory_order_relaxed);
28 } while (id == 0);
29 return id;
30}
const uintptr_t id