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

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 2302393002: Support swap damage rect using eglSwapBuffersWithDamageKHR (Closed)
Patch Set: Update GLSurfaceAdapter Created 4 years, 3 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: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index 9ef7f09c688460376722547516841728526fc8e7..bf418249393e8cd9c5a5f62dcfa82160332b6edb 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -1450,6 +1450,27 @@ void GLES2Implementation::SwapBuffers() {
}
}
+void GLES2Implementation::SwapBuffersWithDamageCHROMIUM(GLint x,
+ GLint y,
+ GLint width,
+ GLint height) {
+ GPU_CLIENT_SINGLE_THREAD_CHECK();
+ GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glSwapBuffersWithDamageCHROMIUM("
+ << x << ", " << y << ", " << width << ", " << height
+ << ")");
+ TRACE_EVENT2("gpu", "GLES2::SwapBuffersWithDamageCHROMIUM", "width", width,
+ "height", height);
+
+ // Same flow control as GLES2Implementation::SwapBuffers (see comments there).
+ swap_buffers_tokens_.push(helper_->InsertToken());
+ helper_->SwapBuffersWithDamageCHROMIUM(x, y, width, height);
+ helper_->CommandBufferHelper::Flush();
+ if (swap_buffers_tokens_.size() > kMaxSwapBuffers + 1) {
+ helper_->WaitForToken(swap_buffers_tokens_.front());
+ swap_buffers_tokens_.pop();
+ }
+}
+
void GLES2Implementation::SwapInterval(int interval) {
GPU_CLIENT_SINGLE_THREAD_CHECK();
GPU_CLIENT_LOG("[" << GetLogPrefix() << "] glSwapInterval("
@@ -4745,6 +4766,11 @@ void GLES2Implementation::Swap() {
SwapBuffers();
}
+void GLES2Implementation::SwapWithDamage(const gfx::Rect& damage) {
+ SwapBuffersWithDamageCHROMIUM(damage.x(), damage.y(), damage.width(),
+ damage.height());
+}
+
void GLES2Implementation::PartialSwapBuffers(const gfx::Rect& sub_buffer) {
PostSubBufferCHROMIUM(
sub_buffer.x(), sub_buffer.y(), sub_buffer.width(), sub_buffer.height());
« no previous file with comments | « gpu/command_buffer/client/gles2_implementation.h ('k') | gpu/command_buffer/client/gles2_implementation_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698