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

Unified Diff: content/browser/compositor/reflector_texture.h

Issue 1123763003: Draw the offscreen texture to reflector's surface without extra copy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moved texture code to ReflectorTexture Created 5 years, 7 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: content/browser/compositor/reflector_texture.h
diff --git a/content/browser/compositor/reflector_texture.h b/content/browser/compositor/reflector_texture.h
new file mode 100644
index 0000000000000000000000000000000000000000..cacabd39c15eac5f80e1ffdf48e22034162b7a24
--- /dev/null
+++ b/content/browser/compositor/reflector_texture.h
@@ -0,0 +1,47 @@
+// Copyright 2015 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 CONTENT_BROWSER_COMPOSITOR_REFLECTOR_TEXTURE_H_
+#define CONTENT_BROWSER_COMPOSITOR_REFLECTOR_TEXTURE_H_
+
+#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
+#include "content/browser/compositor/owned_mailbox.h"
+#include "content/common/content_export.h"
+
+namespace cc {
+class ContextProvider;
+}
+
+namespace gfx {
+class Rect;
+class Size;
+}
+
+namespace content {
+class GLHelper;
+
+// Create and manages texture mailbox to be used by Reflector.
+class CONTENT_EXPORT ReflectorTexture {
+ public:
+ explicit ReflectorTexture(cc::ContextProvider* provider);
+ ~ReflectorTexture();
+
+ void CopyTextureFullImage(const gfx::Size& size);
+ void CopyTextureSubImage(const gfx::Rect& size);
+
+ uint32 texture_id() const { return texture_id_; }
+ scoped_refptr<OwnedMailbox> mailbox() { return mailbox_; }
+
+ private:
+ scoped_refptr<OwnedMailbox> mailbox_;
+ scoped_ptr<GLHelper> gl_helper_;
+ uint32 texture_id_;
+
+ DISALLOW_COPY_AND_ASSIGN(ReflectorTexture);
+};
+
+} // namespace content
+
+#endif
« no previous file with comments | « content/browser/compositor/reflector_impl_unittest.cc ('k') | content/browser/compositor/reflector_texture.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698