Flutter Engine
The Flutter Engine
Functions
SkBitmap.cpp File Reference
#include "include/core/SkBitmap.h"
#include "include/core/SkColorSpace.h"
#include "include/core/SkColorType.h"
#include "include/core/SkImage.h"
#include "include/core/SkMallocPixelRef.h"
#include "include/core/SkMatrix.h"
#include "include/core/SkPaint.h"
#include "include/core/SkPixelRef.h"
#include "include/core/SkRect.h"
#include "include/core/SkShader.h"
#include "include/core/SkTileMode.h"
#include "include/private/base/SkAlign.h"
#include "include/private/base/SkTFitsIn.h"
#include "include/private/base/SkTemplates.h"
#include "include/private/base/SkTo.h"
#include "src/core/SkConvertPixels.h"
#include "src/core/SkImageInfoPriv.h"
#include "src/core/SkImagePriv.h"
#include "src/core/SkMask.h"
#include "src/core/SkMaskFilterBase.h"
#include "src/core/SkMipmap.h"
#include "src/core/SkPixelRefPriv.h"
#include "src/core/SkWritePixelsRec.h"
#include "src/shaders/SkImageShader.h"
#include <cstring>
#include <utility>

Go to the source code of this file.

Functions

static bool reset_return_false (SkBitmap *bm)
 
static void invoke_release_proc (void(*proc)(void *pixels, void *ctx), void *pixels, void *ctx)
 
static bool GetBitmapAlpha (const SkBitmap &src, uint8_t *SK_RESTRICT alpha, int alphaRowBytes)
 

Function Documentation

◆ GetBitmapAlpha()

static bool GetBitmapAlpha ( const SkBitmap src,
uint8_t *SK_RESTRICT  alpha,
int  alphaRowBytes 
)
static

Definition at line 523 of file SkBitmap.cpp.

523 {
524 SkASSERT(alpha != nullptr);
525 SkASSERT(alphaRowBytes >= src.width());
526
527 SkPixmap pmap;
528 if (!src.peekPixels(&pmap)) {
529 for (int y = 0; y < src.height(); ++y) {
530 memset(alpha, 0, src.width());
531 alpha += alphaRowBytes;
532 }
533 return false;
534 }
535 return SkConvertPixels(SkImageInfo::MakeA8(pmap.width(), pmap.height()), alpha, alphaRowBytes,
536 pmap.info(), pmap.addr(), pmap.rowBytes());
537}
#define SkASSERT(cond)
Definition: SkAssert.h:116
bool SkConvertPixels(const SkImageInfo &dstInfo, void *dstPixels, size_t dstRB, const SkImageInfo &srcInfo, const void *srcPixels, size_t srcRB)
size_t rowBytes() const
Definition: SkPixmap.h:145
int width() const
Definition: SkPixmap.h:160
const SkImageInfo & info() const
Definition: SkPixmap.h:135
const void * addr() const
Definition: SkPixmap.h:153
int height() const
Definition: SkPixmap.h:166
double y
static SkImageInfo MakeA8(int width, int height)

◆ invoke_release_proc()

static void invoke_release_proc ( void(*)(void *pixels, void *ctx)  proc,
void *  pixels,
void *  ctx 
)
static

Definition at line 317 of file SkBitmap.cpp.

317 {
318 if (proc) {
319 proc(pixels, ctx);
320 }
321}

◆ reset_return_false()

static bool reset_return_false ( SkBitmap bm)
static

Definition at line 38 of file SkBitmap.cpp.

38 {
39 bm->reset();
40 return false;
41}
void reset()
Definition: SkBitmap.cpp:92