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

Unified Diff: gpu/ipc/service/image_transport_surface_overlay_mac.mm

Issue 2067503003: Add a new command buffer function glScheduleCALayerInUseQueryCHROMIUM. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Include gl_image.h 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « gpu/ipc/service/image_transport_surface_overlay_mac.h ('k') | ui/gl/gl_enums_implementation_autogen.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/ipc/service/image_transport_surface_overlay_mac.mm
diff --git a/gpu/ipc/service/image_transport_surface_overlay_mac.mm b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
index 1ced5d09fe883c99e9e6531bd40af9c9056e4e24..fef796a7c0f7c91138b60db3998cb34669a3356b 100644
--- a/gpu/ipc/service/image_transport_surface_overlay_mac.mm
+++ b/gpu/ipc/service/image_transport_surface_overlay_mac.mm
@@ -158,6 +158,18 @@ void ImageTransportSurfaceOverlayMac::SendAcceleratedSurfaceBuffersSwapped(
params.scale_factor = scale_factor;
params.latency_info = std::move(latency_info);
params.result = gfx::SwapResult::SWAP_ACK;
+
+ // TODO(erikchen): Re-enable this logic alongside the client code that
+ // consumes this response. https://crbug.com/608026.
+ // for (auto& query : io_surface_in_use_queries_) {
+ // SwapBuffersCompletedIOSurfaceInUseQuery response;
+ // response.texture = query.texture;
+ // response.in_use =
+ // query.io_surface.get() && IOSurfaceIsInUse(query.io_surface.get());
+ // params.in_use_queries.push_back(std::move(response));
+ // }
+ io_surface_in_use_queries_.clear();
+
stub_->SendSwapBuffersCompleted(params);
}
@@ -326,6 +338,20 @@ bool ImageTransportSurfaceOverlayMac::ScheduleCALayer(
edge_aa_mask, opacity, filter);
}
+void ImageTransportSurfaceOverlayMac::ScheduleCALayerInUseQuery(
+ std::vector<CALayerInUseQuery> queries) {
+ for (auto& query : queries) {
+ IOSurfaceInUseQuery io_surface_query;
+ io_surface_query.texture = query.texture;
+ if (query.image) {
+ gl::GLImageIOSurface* io_surface_image =
+ static_cast<gl::GLImageIOSurface*>(query.image.get());
+ io_surface_query.io_surface = io_surface_image->io_surface();
+ }
+ io_surface_in_use_queries_.push_back(std::move(io_surface_query));
+ }
+}
+
bool ImageTransportSurfaceOverlayMac::IsSurfaceless() const {
return true;
}
@@ -361,4 +387,13 @@ void ImageTransportSurfaceOverlayMac::OnGpuSwitched() {
FROM_HERE, base::Bind(&IOSurfaceContextNoOp, context_on_new_gpu));
}
+ImageTransportSurfaceOverlayMac::IOSurfaceInUseQuery::IOSurfaceInUseQuery() =
+ default;
+ImageTransportSurfaceOverlayMac::IOSurfaceInUseQuery::IOSurfaceInUseQuery(
+ const IOSurfaceInUseQuery&) = default;
+ImageTransportSurfaceOverlayMac::IOSurfaceInUseQuery::IOSurfaceInUseQuery(
+ IOSurfaceInUseQuery&&) = default;
+ImageTransportSurfaceOverlayMac::IOSurfaceInUseQuery::~IOSurfaceInUseQuery() =
+ default;
+
} // namespace gpu
« no previous file with comments | « gpu/ipc/service/image_transport_surface_overlay_mac.h ('k') | ui/gl/gl_enums_implementation_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698