Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Namespaces | Functions
ProxyCache.cpp File Reference
#include "src/gpu/graphite/ProxyCache.h"
#include "include/core/SkBitmap.h"
#include "include/core/SkPixelRef.h"
#include "include/gpu/GpuTypes.h"
#include "src/core/SkMipmap.h"
#include "src/gpu/ResourceKey.h"
#include "src/gpu/graphite/RecorderPriv.h"
#include "src/gpu/graphite/Texture.h"
#include "src/gpu/graphite/TextureProxy.h"
#include "src/gpu/graphite/TextureUtils.h"

Go to the source code of this file.

Namespaces

namespace  skgpu
 
namespace  skgpu::graphite
 

Functions

 DECLARE_SKMESSAGEBUS_MESSAGE (skgpu::UniqueKeyInvalidatedMsg_Graphite, uint32_t, true) namespace
 

Function Documentation

◆ DECLARE_SKMESSAGEBUS_MESSAGE()

DECLARE_SKMESSAGEBUS_MESSAGE ( skgpu::UniqueKeyInvalidatedMsg_Graphite  ,
uint32_t  ,
true   
)

Definition at line 22 of file ProxyCache.cpp.

25 {
26
27void make_bitmap_key(skgpu::UniqueKey* key, const SkBitmap& bm, skgpu::Mipmapped mipmapped) {
29
30 SkIPoint origin = bm.pixelRefOrigin();
31 SkIRect subset = SkIRect::MakePtSize(origin, bm.dimensions());
32
33 static const skgpu::UniqueKey::Domain kProxyCacheDomain = skgpu::UniqueKey::GenerateDomain();
34 skgpu::UniqueKey::Builder builder(key, kProxyCacheDomain, 6, "ProxyCache");
35 builder[0] = bm.pixelRef()->getGenerationID();
36 builder[1] = subset.fLeft;
37 builder[2] = subset.fTop;
38 builder[3] = subset.fRight;
39 builder[4] = subset.fBottom;
40 builder[5] = SkToBool(mipmapped);
41}
42
43sk_sp<SkIDChangeListener> make_unique_key_invalidation_listener(const skgpu::UniqueKey& key,
44 uint32_t recorderID) {
45 class Listener : public SkIDChangeListener {
46 public:
47 Listener(const skgpu::UniqueKey& key, uint32_t recorderUniqueID)
48 : fMsg(key, recorderUniqueID) {}
49
50 void changed() override {
52 }
53
54 private:
56 };
57
58 return sk_make_sp<Listener>(key, recorderID);
59}
60
61} // anonymous namespace
#define SkASSERT(cond)
Definition SkAssert.h:116
static constexpr bool SkToBool(const T &x)
Definition SkTo.h:35
SkIPoint pixelRefOrigin() const
Definition SkBitmap.cpp:168
SkPixelRef * pixelRef() const
Definition SkBitmap.h:720
SkISize dimensions() const
Definition SkBitmap.h:388
virtual void changed()=0
static void Post(Message m)
uint32_t getGenerationID() const
static Domain GenerateDomain()
Mipmapped
Definition GpuTypes.h:53
int32_t fBottom
larger y-axis bounds
Definition SkRect.h:36
int32_t fTop
smaller y-axis bounds
Definition SkRect.h:34
int32_t fLeft
smaller x-axis bounds
Definition SkRect.h:33
static constexpr SkIRect MakePtSize(SkIPoint pt, SkISize size)
Definition SkRect.h:78
int32_t fRight
larger x-axis bounds
Definition SkRect.h:35