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

Unified Diff: cc/surfaces/surface.h

Issue 2503203002: Revert "Getting rid of DelegatedFrameData" (Closed)
Patch Set: Created 4 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
« no previous file with comments | « cc/surfaces/display_unittest.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/surfaces/surface.h
diff --git a/cc/surfaces/surface.h b/cc/surfaces/surface.h
index 9fe86a2761bfb0cc6e65ec80d0179c62572bfec7..ad29d8142747f94f6ef7d05eddf541faaf72b697 100644
--- a/cc/surfaces/surface.h
+++ b/cc/surfaces/surface.h
@@ -17,7 +17,6 @@
#include "base/callback.h"
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
-#include "base/optional.h"
#include "cc/output/copy_output_request.h"
#include "cc/quads/render_pass_id.h"
#include "cc/surfaces/frame_sink_id.h"
@@ -61,7 +60,8 @@ class CC_SURFACES_EXPORT Surface {
copy_requests);
// Returns the most recent frame that is eligible to be rendered.
- // You must check whether HasFrame() returns true before calling this method.
+ // If the CompositorFrame's DelegateFrameData is null then there is
+ // no eligible frame.
const CompositorFrame& GetEligibleFrame();
// Returns a number that increments by 1 every time a new frame is enqueued.
@@ -89,20 +89,18 @@ class CC_SURFACES_EXPORT Surface {
return referenced_surfaces_;
}
- bool HasFrame() const { return current_frame_.has_value(); }
-
bool destroyed() const { return destroyed_; }
void set_destroyed(bool destroyed) { destroyed_ = destroyed; }
private:
- void UnrefFrameResources(const CompositorFrame& frame_data);
+ void UnrefFrameResources(DelegatedFrameData* frame_data);
void ClearCopyRequests();
SurfaceId surface_id_;
SurfaceId previous_frame_surface_id_;
base::WeakPtr<SurfaceFactory> factory_;
// TODO(jamesr): Support multiple frames in flight.
- base::Optional<CompositorFrame> current_frame_;
+ CompositorFrame current_frame_;
int frame_index_;
bool destroyed_;
std::vector<SurfaceSequence> destruction_dependencies_;
« no previous file with comments | « cc/surfaces/display_unittest.cc ('k') | cc/surfaces/surface.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698