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

Unified Diff: cc/output/gl_renderer.h

Issue 2473973002: NOT for review (for discussion): Query IOSurfaceIsInUse in the browser process
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 | « no previous file | cc/output/gl_renderer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/output/gl_renderer.h
diff --git a/cc/output/gl_renderer.h b/cc/output/gl_renderer.h
index 07ede049a7274ee93edda2d37c7e425dc0b1d36c..3c39593282c3a76a5fd79196b9e321823d917fd9 100644
--- a/cc/output/gl_renderer.h
+++ b/cc/output/gl_renderer.h
@@ -264,24 +264,36 @@ class CC_EXPORT GLRenderer : public DirectRenderer {
gfx::RectF* new_bounds);
// Schedules the |ca_layer_overlay|, which is guaranteed to have a non-null
- // |rpdq| parameter.
- void ScheduleRenderPassDrawQuad(const CALayerOverlay* ca_layer_overlay,
- DrawingFrame* external_frame);
+ // |rpdq| parameter. Returns the resource lock for the layer contents.
+ std::unique_ptr<ResourceProvider::ScopedReadLockGL>
+ ScheduleRenderPassDrawQuad(const CALayerOverlay* ca_layer_overlay,
+ DrawingFrame* external_frame);
using OverlayResourceLock =
std::unique_ptr<ResourceProvider::ScopedReadLockGL>;
using OverlayResourceLockList = std::vector<OverlayResourceLock>;
+ // A resource lock for a resource that was used by ScheduleCALayer. The
+ // resource can only be unlocked once its GpuMemoryBuffer is no longer in
+ // use.
+ struct CALayerResourceLock {
+ CALayerResourceLock();
+ ~CALayerResourceLock();
+ CALayerResourceLock(CALayerResourceLock&& ca_layer_resource);
+
+ uint32_t outstanding_ack_count = 0;
+ std::unique_ptr<ResourceProvider::ScopedReadLockGL> lock;
+ std::unique_ptr<gfx::GpuMemoryBuffer> gpu_memory_buffer;
+ bool in_use_valid = false;
+ };
+ std::map<unsigned, CALayerResourceLock> ca_layer_resources_;
+
// Resources that have been sent to the GPU process, but not yet swapped.
OverlayResourceLockList pending_overlay_resources_;
// Resources that should be shortly swapped by the GPU process.
std::deque<OverlayResourceLockList> swapping_overlay_resources_;
- // Resources that the GPU process has finished swapping. The key is the
- // texture id of the resource.
- std::map<unsigned, OverlayResourceLock> swapped_and_acked_overlay_resources_;
-
unsigned offscreen_framebuffer_id_;
std::unique_ptr<StaticGeometryBinding> shared_geometry_;
« no previous file with comments | « no previous file | cc/output/gl_renderer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698