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

Unified Diff: content/common/gpu/image_transport_surface_fbo_mac.mm

Issue 1161853006: Mac: Add partial swap support to NSOpenGLContext path (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporate review feedback Created 5 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
Index: content/common/gpu/image_transport_surface_fbo_mac.mm
diff --git a/content/common/gpu/image_transport_surface_fbo_mac.mm b/content/common/gpu/image_transport_surface_fbo_mac.mm
index 102a6b306f898e90f99aade538b73ce88b854227..ec827c2e47ad7f2064a53bcd204417e7da251b54 100644
--- a/content/common/gpu/image_transport_surface_fbo_mac.mm
+++ b/content/common/gpu/image_transport_surface_fbo_mac.mm
@@ -171,6 +171,7 @@ void ImageTransportSurfaceFBO::AdjustBufferAllocation() {
gfx::SwapResult ImageTransportSurfaceFBO::SwapBuffers() {
TRACE_EVENT0("gpu", "ImageTransportSurfaceFBO::SwapBuffers");
+ pending_swap_pixel_damage_rect_ = gfx::Rect(pixel_size_);
return SwapBuffersInternal() ? gfx::SwapResult::SWAP_ACK
: gfx::SwapResult::SWAP_FAILED;
}
@@ -198,10 +199,12 @@ void ImageTransportSurfaceFBO::SendSwapBuffers(uint64 surface_handle,
GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params params;
params.surface_handle = surface_handle;
params.size = pixel_size;
+ params.damage_rect = pending_swap_pixel_damage_rect_;
params.scale_factor = scale_factor;
params.latency_info.swap(latency_info_);
helper_->SendAcceleratedSurfaceBuffersSwapped(params);
is_swap_buffers_send_pending_ = false;
+ pending_swap_pixel_damage_rect_ = gfx::Rect();
}
void ImageTransportSurfaceFBO::SetRendererID(int renderer_id) {
@@ -214,6 +217,7 @@ gfx::SwapResult ImageTransportSurfaceFBO::PostSubBuffer(int x,
int width,
int height) {
TRACE_EVENT0("gpu", "ImageTransportSurfaceFBO::PostSubBuffer");
+ pending_swap_pixel_damage_rect_.Union(gfx::Rect(x, y, width, height));
return SwapBuffersInternal() ? gfx::SwapResult::SWAP_ACK
: gfx::SwapResult::SWAP_FAILED;
}
« no previous file with comments | « content/common/gpu/image_transport_surface_fbo_mac.h ('k') | ui/accelerated_widget_mac/accelerated_widget_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698