Flutter Engine
The Flutter Engine
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) {
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, 5, "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}
41
42sk_sp<SkIDChangeListener> make_unique_key_invalidation_listener(const skgpu::UniqueKey& key,
43 uint32_t recorderID) {
44 class Listener : public SkIDChangeListener {
45 public:
46 Listener(const skgpu::UniqueKey& key, uint32_t recorderUniqueID)
47 : fMsg(key, recorderUniqueID) {}
48
49 void changed() override {
51 }
52
53 private:
55 };
56
57 return sk_make_sp<Listener>(key, recorderID);
58}
59
60} // anonymous namespace
#define SkASSERT(cond)
Definition: SkAssert.h:116
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)
Definition: SkMessageBus.h:130
uint32_t getGenerationID() const
Definition: SkPixelRef.cpp:63
static Domain GenerateDomain()
Definition: ResourceKey.cpp:27
Definition: SkRect.h:32
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