Flutter Engine
The Flutter Engine
Macros | Functions
SkRecorder.cpp File Reference
#include "src/core/SkRecorder.h"
#include "include/core/SkCanvas.h"
#include "include/core/SkData.h"
#include "include/core/SkDrawable.h"
#include "include/core/SkImage.h"
#include "include/core/SkImageFilter.h"
#include "include/core/SkImageInfo.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPicture.h"
#include "include/core/SkPoint.h"
#include "include/core/SkRSXform.h"
#include "include/core/SkRect.h"
#include "include/core/SkShader.h"
#include "include/core/SkString.h"
#include "include/core/SkSurface.h"
#include "include/core/SkTextBlob.h"
#include "include/core/SkVertices.h"
#include "include/private/base/SkFloatingPoint.h"
#include "include/private/base/SkTemplates.h"
#include "include/private/base/SkTo.h"
#include "include/private/chromium/Slug.h"
#include "src/core/SkBigPicture.h"
#include "src/core/SkCanvasPriv.h"
#include "src/core/SkRecord.h"
#include "src/core/SkRecords.h"
#include "src/text/GlyphRun.h"
#include "src/utils/SkPatchUtils.h"
#include <cstdint>
#include <cstring>
#include <memory>
#include <new>

Go to the source code of this file.

Macros

#define INHERITED(method, ...)   this->SkNoDrawCanvas::method(__VA_ARGS__)
 

Functions

static SkIRect safe_picture_bounds (const SkRect &bounds)
 

Macro Definition Documentation

◆ INHERITED

#define INHERITED (   method,
  ... 
)    this->SkNoDrawCanvas::method(__VA_ARGS__)

Definition at line 128 of file SkRecorder.cpp.

Function Documentation

◆ safe_picture_bounds()

static SkIRect safe_picture_bounds ( const SkRect bounds)
static

Definition at line 80 of file SkRecorder.cpp.

80 {
81 SkIRect picBounds = bounds.roundOut();
82 // roundOut() saturates the float edges to +/-SK_MaxS32FitsInFloat (~2billion), but this is
83 // large enough that width/height calculations will overflow, leading to negative dimensions.
84 static constexpr int32_t kSafeEdge = SK_MaxS32FitsInFloat / 2 - 1;
85 static constexpr SkIRect kSafeBounds = {-kSafeEdge, -kSafeEdge, kSafeEdge, kSafeEdge};
86 static_assert((kSafeBounds.fRight - kSafeBounds.fLeft) >= 0 &&
87 (kSafeBounds.fBottom - kSafeBounds.fTop) >= 0);
88 if (!picBounds.intersect(kSafeBounds)) {
89 picBounds.setEmpty();
90 }
91 return picBounds;
92}
constexpr int SK_MaxS32FitsInFloat
Optional< SkRect > bounds
Definition: SkRecords.h:189
Definition: SkRect.h:32
bool intersect(const SkIRect &r)
Definition: SkRect.h:513
int32_t fBottom
larger y-axis bounds
Definition: SkRect.h:36
int32_t fTop
smaller y-axis bounds
Definition: SkRect.h:34
void setEmpty()
Definition: SkRect.h:242
int32_t fLeft
smaller x-axis bounds
Definition: SkRect.h:33
int32_t fRight
larger x-axis bounds
Definition: SkRect.h:35