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

Unified Diff: sky/compositor/layer.h

Issue 740923002: Add a simple compositor for Sky (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: git cl format Created 6 years, 1 month 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: sky/compositor/layer.h
diff --git a/sky/compositor/layer.h b/sky/compositor/layer.h
new file mode 100644
index 0000000000000000000000000000000000000000..94925278652b7e33146d2c5dae537b8f741d9438
--- /dev/null
+++ b/sky/compositor/layer.h
@@ -0,0 +1,46 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef SKY_COMPOSITOR_LAYER_H_
+#define SKY_COMPOSITOR_LAYER_H_
+
+#include "base/memory/ref_counted.h"
+#include "mojo/gpu/gl_texture.h"
+#include "sky/compositor/layer_client.h"
+#include "ui/gfx/geometry/rect.h"
+
+namespace sky {
+class LayerHost;
+
+class Layer : public base::RefCounted<Layer> {
+ public:
+ explicit Layer(LayerClient* client);
+
+ void ClearClient();
+
+ void SetSize(const gfx::Size& size);
+ void Display();
+
+ scoped_ptr<mojo::GLTexture> GetTexture();
+
+ const gfx::Size& size() const { return size_; }
+
+ void set_host(LayerHost* host) { host_ = host; }
eseidel 2014/11/20 20:40:32 Huh? inlined methods are crazy_style?
abarth-chromium 2014/11/20 20:47:57 Trivial getters and setters are crazy_style.
+
+ private:
+ friend class base::RefCounted<Layer>;
eseidel 2014/11/20 20:40:31 You have to add this boilerplate so that RefCounte
abarth-chromium 2014/11/20 20:47:57 Yep. In Blink, we do the opposite (i.e., we make
+ ~Layer();
+
+ LayerClient* client_;
+ LayerHost* host_;
+ gfx::Size size_;
+
+ scoped_ptr<mojo::GLTexture> texture_;
+
+ DISALLOW_COPY_AND_ASSIGN(Layer);
+};
+
+} // namespace sky
+
+#endif // SKY_COMPOSITOR_LAYER_H_

Powered by Google App Engine
This is Rietveld 408576698