mirror of
https://github.com/encounter/engine.git
synced 2026-03-30 11:09:55 -07:00
Move texture registry ownership to platform view (#4348)
* Move texture registry ownership to platform view This enables the texture registry to survive activity pause on Android.
This commit is contained in:
@@ -58,11 +58,11 @@ CompositorContext::ScopedFrame::~ScopedFrame() {
|
||||
}
|
||||
|
||||
void CompositorContext::OnGrContextCreated() {
|
||||
texture_registry_.OnGrContextCreated();
|
||||
texture_registry_->OnGrContextCreated();
|
||||
}
|
||||
|
||||
void CompositorContext::OnGrContextDestroyed() {
|
||||
texture_registry_.OnGrContextDestroyed();
|
||||
texture_registry_->OnGrContextDestroyed();
|
||||
raster_cache_.Clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ class CompositorContext {
|
||||
|
||||
RasterCache& raster_cache() { return raster_cache_; }
|
||||
|
||||
TextureRegistry& texture_registry() { return texture_registry_; }
|
||||
TextureRegistry& texture_registry() { return *texture_registry_; }
|
||||
|
||||
const Counter& frame_count() const { return frame_count_; }
|
||||
|
||||
@@ -72,9 +72,13 @@ class CompositorContext {
|
||||
|
||||
const CounterValues& memory_usage() const { return memory_usage_; }
|
||||
|
||||
void SetTextureRegistry(TextureRegistry* textureRegistry) {
|
||||
texture_registry_ = textureRegistry;
|
||||
}
|
||||
|
||||
private:
|
||||
RasterCache raster_cache_;
|
||||
TextureRegistry texture_registry_;
|
||||
TextureRegistry* texture_registry_;
|
||||
std::unique_ptr<ProcessInfo> process_info_;
|
||||
Counter frame_count_;
|
||||
Stopwatch frame_time_;
|
||||
|
||||
Reference in New Issue
Block a user