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

Side by Side Diff: components/exo/wayland/clients/motion_events.cc

Issue 2569613002: exo: Send damage to compositor when committing new buffer. (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Implementation of a client that produces output in the form of RGBA 5 // Implementation of a client that produces output in the form of RGBA
6 // buffers when receiving pointer/touch events. RGB contains the lower 6 // buffers when receiving pointer/touch events. RGB contains the lower
7 // 24 bits of the event timestamp and A is 0xff. 7 // 24 bits of the event timestamp and A is 0xff.
8 8
9 #include <fcntl.h> 9 #include <fcntl.h>
10 #include <linux-dmabuf-unstable-v1-client-protocol.h> 10 #include <linux-dmabuf-unstable-v1-client-protocol.h>
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 ++frames; 666 ++frames;
667 benchmark_wall_time += base::TimeTicks::Now() - wall_time_start; 667 benchmark_wall_time += base::TimeTicks::Now() - wall_time_start;
668 benchmark_cpu_time += base::ThreadTicks::Now() - cpu_time_start; 668 benchmark_cpu_time += base::ThreadTicks::Now() - cpu_time_start;
669 } 669 }
670 continue; 670 continue;
671 } 671 }
672 672
673 if (!frame.callback_pending) { 673 if (!frame.callback_pending) {
674 DCHECK_GT(pending_frames.size(), 0u); 674 DCHECK_GT(pending_frames.size(), 0u);
675 wl_surface_set_buffer_scale(surface.get(), scale_); 675 wl_surface_set_buffer_scale(surface.get(), scale_);
676 wl_surface_damage(surface.get(), 0, 0, width_ / scale_, height_ / scale_);
676 wl_surface_attach(surface.get(), pending_frames.front(), 0, 0); 677 wl_surface_attach(surface.get(), pending_frames.front(), 0, 0);
677 pending_frames.pop_front(); 678 pending_frames.pop_front();
678 679
679 frame_callback.reset(wl_surface_frame(surface.get())); 680 frame_callback.reset(wl_surface_frame(surface.get()));
680 wl_callback_add_listener(frame_callback.get(), &frame_listener, &frame); 681 wl_callback_add_listener(frame_callback.get(), &frame_listener, &frame);
681 frame.callback_pending = true; 682 frame.callback_pending = true;
682 wl_surface_commit(surface.get()); 683 wl_surface_commit(surface.get());
683 wl_display_flush(display_.get()); 684 wl_display_flush(display_.get());
684 continue; 685 continue;
685 } 686 }
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
881 new std::string(command_line->GetSwitchValueASCII(switches::kUseDrm))); 882 new std::string(command_line->GetSwitchValueASCII(switches::kUseDrm)));
882 } 883 }
883 884
884 exo::wayland::clients::MotionEvents client( 885 exo::wayland::clients::MotionEvents client(
885 width, height, scale, num_rects, max_frames_pending, 886 width, height, scale, num_rects, max_frames_pending,
886 command_line->HasSwitch(switches::kFullscreen), 887 command_line->HasSwitch(switches::kFullscreen),
887 command_line->HasSwitch(switches::kShowFpsCounter), num_benchmark_runs, 888 command_line->HasSwitch(switches::kShowFpsCounter), num_benchmark_runs,
888 base::TimeDelta::FromMilliseconds(benchmark_interval_ms), use_drm.get()); 889 base::TimeDelta::FromMilliseconds(benchmark_interval_ms), use_drm.get());
889 return client.Run(); 890 return client.Run();
890 } 891 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698