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

Unified Diff: mojo/services/public/cpp/view_manager/lib/bitmap_uploader.h

Issue 555953007: Fixes for surfaces bindings exposed by wm_flow app (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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: mojo/services/public/cpp/view_manager/lib/bitmap_uploader.h
diff --git a/mojo/services/public/cpp/view_manager/lib/bitmap_uploader.h b/mojo/services/public/cpp/view_manager/lib/bitmap_uploader.h
index ac78f359749085da62b0139751bc2edfc00f409c..f04940943cbfbc8c73af5316dba38dbbad19af7c 100644
--- a/mojo/services/public/cpp/view_manager/lib/bitmap_uploader.h
+++ b/mojo/services/public/cpp/view_manager/lib/bitmap_uploader.h
@@ -10,6 +10,7 @@
#include "base/memory/weak_ptr.h"
#include "cc/surfaces/surface_id.h"
#include "mojo/public/c/gles2/gles2.h"
+#include "mojo/services/public/cpp/view_manager/types.h"
#include "mojo/services/public/interfaces/gpu/gpu.mojom.h"
#include "mojo/services/public/interfaces/surfaces/surfaces.mojom.h"
#include "mojo/services/public/interfaces/surfaces/surfaces_service.mojom.h"
@@ -21,27 +22,37 @@ class SurfaceIdAllocator;
}
namespace mojo {
+class ViewManagerClientImpl;
class BitmapUploader : public SurfaceClient {
public:
- BitmapUploader(SurfacesServicePtr surfaces_service, GpuPtr gpu_service);
+ BitmapUploader(ViewManagerClientImpl* client,
+ Id view_id,
+ SurfacesServicePtr surfaces_service,
+ GpuPtr gpu_service);
virtual ~BitmapUploader();
- void Upload(SkBitmap bitmap,
- const base::Callback<void(SurfaceIdPtr)>& done_callback);
+ void SetSize(const gfx::Size& size);
+ void SetColor(SkColor color);
+ void SetBitmap(SkBitmap bitmap);
+ void SetDoneCallback(const base::Callback<void(SurfaceIdPtr)>& done_callback);
private:
+ void Upload();
void OnSurfaceConnectionCreated(SurfacePtr surface, uint32_t id_namespace);
uint32_t BindTextureForSize(const gfx::Size size);
// SurfaceClient implementation.
virtual void ReturnResources(Array<ReturnedResourcePtr> resources) OVERRIDE;
+ ViewManagerClientImpl* client_;
+ Id view_id_;
SurfacesServicePtr surfaces_service_;
GpuPtr gpu_service_;
MojoGLES2Context gles2_context_;
- // Used to hold on to the bitmap until we can upload it.
+ gfx::Size size_;
+ SkColor color_;
SkBitmap bitmap_;
base::Callback<void(SurfaceIdPtr)> done_callback_;
SurfacePtr surface_;
« no previous file with comments | « mojo/examples/wm_flow/embedded/embedded.cc ('k') | mojo/services/public/cpp/view_manager/lib/bitmap_uploader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698