Remove PlatformFile from profile_browsertest
[chromium-blink-merge.git] / content / browser / compositor / owned_mailbox.h
blob6fc425800157d0c2879b2b8a1eeb75a4ad4ed852
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CONTENT_BROWSER_COMPOSITOR_OWNED_MAILBOX_H_
6 #define CONTENT_BROWSER_COMPOSITOR_OWNED_MAILBOX_H_
8 #include "base/memory/ref_counted.h"
9 #include "content/browser/compositor/image_transport_factory.h"
10 #include "content/common/content_export.h"
11 #include "gpu/command_buffer/common/mailbox_holder.h"
13 namespace content {
15 class GLHelper;
17 // This class holds a texture id and gpu::Mailbox, and deletes the texture
18 // id when the object itself is destroyed. Should only be created if a GLHelper
19 // exists on the ImageTransportFactory.
20 class CONTENT_EXPORT OwnedMailbox : public base::RefCounted<OwnedMailbox>,
21 public ImageTransportFactoryObserver {
22 public:
23 explicit OwnedMailbox(GLHelper* gl_helper);
25 const gpu::Mailbox& mailbox() const { return mailbox_holder_.mailbox; }
26 uint32 texture_id() const { return texture_id_; }
27 uint32 target() const { return mailbox_holder_.texture_target; }
28 uint32 sync_point() const { return mailbox_holder_.sync_point; }
29 void UpdateSyncPoint(uint32 sync_point);
30 void Destroy();
32 protected:
33 virtual ~OwnedMailbox();
35 // ImageTransportFactoryObserver implementation.
36 virtual void OnLostResources() OVERRIDE;
38 private:
39 friend class base::RefCounted<OwnedMailbox>;
41 uint32 texture_id_;
42 gpu::MailboxHolder mailbox_holder_;
43 GLHelper* gl_helper_;
46 } // namespace content
48 #endif // CONTENT_BROWSER_COMPOSITOR_OWNED_MAILBOX_H_