Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(69)

Unified Diff: services/ui/demo/bitmap_uploader.h

Issue 2440453002: Splitting the Mus demo code out of a service. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: services/ui/demo/bitmap_uploader.h
diff --git a/services/ui/demo/bitmap_uploader.h b/services/ui/demo/bitmap_uploader.h
index b9f9af79ea7e9d5088aa25813a19e9564a975d44..dbeea37a248425a2fc2570da198a4275a28e7695 100644
--- a/services/ui/demo/bitmap_uploader.h
+++ b/services/ui/demo/bitmap_uploader.h
@@ -12,12 +12,17 @@
#include "base/compiler_specific.h"
#include "base/containers/hash_tables.h"
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "gpu/GLES2/gl2chromium.h"
#include "gpu/GLES2/gl2extchromium.h"
#include "services/ui/public/cpp/window_surface.h"
#include "services/ui/public/cpp/window_surface_client.h"
#include "services/ui/public/interfaces/surface.mojom.h"
+namespace gpu {
+class GpuChannelHost;
+}
+
namespace ui {
class GLES2Context;
class GpuService;
@@ -49,6 +54,8 @@ class BitmapUploader : public WindowSurfaceClient {
private:
void Upload();
+ void OnGpuChannelEstablished(scoped_refptr<gpu::GpuChannelHost> gpu_channel);
+
uint32_t BindTextureForSize(const gfx::Size& size);
uint32_t TextureFormat() const {
@@ -75,6 +82,8 @@ class BitmapUploader : public WindowSurfaceClient {
uint32_t next_resource_id_;
base::hash_map<uint32_t, uint32_t> resource_to_texture_id_map_;
+ base::WeakPtrFactory<BitmapUploader> weak_factory_;
+
DISALLOW_COPY_AND_ASSIGN(BitmapUploader);
};

Powered by Google App Engine
This is Rietveld 408576698