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

Unified Diff: examples/surfaces_app/child_gl_impl.h

Issue 826423008: Use local ids for Surfaces APIs that can only apply to local surfaces (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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
« no previous file with comments | « examples/ganesh_app/texture_uploader.cc ('k') | examples/surfaces_app/child_gl_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: examples/surfaces_app/child_gl_impl.h
diff --git a/examples/surfaces_app/child_gl_impl.h b/examples/surfaces_app/child_gl_impl.h
index ac241aa06977611145ed6588c54febb76e0c716c..d1dc90b0a692b7fdcc55cd8e3776db413715156e 100644
--- a/examples/surfaces_app/child_gl_impl.h
+++ b/examples/surfaces_app/child_gl_impl.h
@@ -8,10 +8,8 @@
#include "base/containers/hash_tables.h"
#include "base/macros.h"
#include "base/memory/scoped_ptr.h"
-#include "base/memory/weak_ptr.h"
#include "base/time/time.h"
#include "cc/surfaces/surface_id.h"
-#include "cc/surfaces/surface_id_allocator.h"
#include "examples/sample_app/spinning_cube.h"
#include "examples/surfaces_app/child.mojom.h"
#include "mojo/public/c/gles2/gles2.h"
@@ -38,31 +36,32 @@ class ChildGLImpl : public InterfaceImpl<Child>, public SurfaceClient {
CommandBufferPtr command_buffer);
~ChildGLImpl() override;
+ private:
+ using ProduceCallback = mojo::Callback<void(SurfaceIdPtr id)>;
+
+ // Child implementation.
+ void ProduceFrame(ColorPtr color,
+ SizePtr size,
+ const ProduceCallback& callback) override;
+
// SurfaceClient implementation
void SetIdNamespace(uint32_t id_namespace) override;
void ReturnResources(Array<ReturnedResourcePtr> resources) override;
- private:
- // Child implementation.
- void ProduceFrame(
- ColorPtr color,
- SizePtr size,
- const mojo::Callback<void(SurfaceIdPtr id)>& callback) override;
-
- void AllocateSurface();
void Draw();
+ void RunProduceCallback();
SkColor color_;
gfx::Size size_;
- scoped_ptr<cc::SurfaceIdAllocator> allocator_;
SurfacePtr surface_;
MojoGLES2Context context_;
- cc::SurfaceId id_;
+ uint32_t id_namespace_;
+ uint32_t local_id_;
::examples::SpinningCube cube_;
base::TimeTicks start_time_;
uint32_t next_resource_id_;
base::hash_map<uint32_t, GLuint> id_to_tex_map_;
- base::WeakPtrFactory<ChildGLImpl> weak_factory_;
+ ProduceCallback produce_callback_;
DISALLOW_COPY_AND_ASSIGN(ChildGLImpl);
};
« no previous file with comments | « examples/ganesh_app/texture_uploader.cc ('k') | examples/surfaces_app/child_gl_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698