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

Side by Side Diff: components/exo/buffer.h

Issue 2083853002: exo: Recreate Surface resources on context lost. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make ContextFactory pure; hold on to buffer reference Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_EXO_BUFFER_H_ 5 #ifndef COMPONENTS_EXO_BUFFER_H_
6 #define COMPONENTS_EXO_BUFFER_H_ 6 #define COMPONENTS_EXO_BUFFER_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // Set the callback to run when the buffer is no longer used by the 49 // Set the callback to run when the buffer is no longer used by the
50 // compositor. The client is free to re-use or destroy this buffer and 50 // compositor. The client is free to re-use or destroy this buffer and
51 // its backing storage after this has been called. 51 // its backing storage after this has been called.
52 void set_release_callback(const base::Closure& release_callback) { 52 void set_release_callback(const base::Closure& release_callback) {
53 release_callback_ = release_callback; 53 release_callback_ = release_callback;
54 } 54 }
55 55
56 // This function can be used to acquire a texture mailbox for the contents of 56 // This function can be used to acquire a texture mailbox for the contents of
57 // buffer. Returns a release callback on success. The release callback should 57 // buffer. Returns a release callback on success. The release callback should
58 // be called before a new texture mailbox can be acquired unless 58 // be called before a new texture mailbox can be acquired unless
59 // |non_client_usage| is true. 59 // |non_client_usage| is true. |detach_callback| receives a callback that
60 // should be called when the buffer is detached from the current surface.
60 std::unique_ptr<cc::SingleReleaseCallback> ProduceTextureMailbox( 61 std::unique_ptr<cc::SingleReleaseCallback> ProduceTextureMailbox(
61 cc::TextureMailbox* mailbox, 62 cc::TextureMailbox* mailbox,
62 bool secure_output_only, 63 bool secure_output_only,
63 bool client_usage); 64 bool client_usage,
65 base::Closure* detach_callback);
reveman 2016/06/22 17:15:26 hm, I see how this works but it took a minute for
jbauman 2016/06/22 23:45:48 Done.
64 66
65 // Returns the size of the buffer. 67 // Returns the size of the buffer.
66 gfx::Size GetSize() const; 68 gfx::Size GetSize() const;
67 69
68 // Returns a trace value representing the state of the buffer. 70 // Returns a trace value representing the state of the buffer.
69 std::unique_ptr<base::trace_event::TracedValue> AsTracedValue() const; 71 std::unique_ptr<base::trace_event::TracedValue> AsTracedValue() const;
70 72
71 private: 73 private:
72 class Texture; 74 class Texture;
73 75
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 116
115 // The client release callback. 117 // The client release callback.
116 base::Closure release_callback_; 118 base::Closure release_callback_;
117 119
118 DISALLOW_COPY_AND_ASSIGN(Buffer); 120 DISALLOW_COPY_AND_ASSIGN(Buffer);
119 }; 121 };
120 122
121 } // namespace exo 123 } // namespace exo
122 124
123 #endif // COMPONENTS_EXO_BUFFER_H_ 125 #endif // COMPONENTS_EXO_BUFFER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698