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:
Sigurd Meldgaard
2017-11-22 09:55:45 +01:00
committed by GitHub
parent fbd384329b
commit e58764fbe0
9 changed files with 27 additions and 6 deletions
+2 -2
View File
@@ -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();
}
+6 -2
View File
@@ -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_;