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

Side by Side Diff: remoting/client/jni/jni_frame_consumer.cc

Issue 1236663002: Allow shaped-desktop hosts to send shape only when it changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Pepper 2D renderer build Created 5 years, 5 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 unified diff | Download patch
« no previous file with comments | « remoting/client/jni/jni_frame_consumer.h ('k') | remoting/client/plugin/chromoting_instance.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 #include "remoting/client/jni/jni_frame_consumer.h" 5 #include "remoting/client/jni/jni_frame_consumer.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/stl_util.h" 9 #include "base/stl_util.h"
10 #include "base/synchronization/waitable_event.h" 10 #include "base/synchronization/waitable_event.h"
(...skipping 28 matching lines...) Expand all
39 } 39 }
40 40
41 void JniFrameConsumer::set_frame_producer(FrameProducer* producer) { 41 void JniFrameConsumer::set_frame_producer(FrameProducer* producer) {
42 frame_producer_ = producer; 42 frame_producer_ = producer;
43 } 43 }
44 44
45 void JniFrameConsumer::ApplyBuffer(const webrtc::DesktopSize& view_size, 45 void JniFrameConsumer::ApplyBuffer(const webrtc::DesktopSize& view_size,
46 const webrtc::DesktopRect& clip_area, 46 const webrtc::DesktopRect& clip_area,
47 webrtc::DesktopFrame* buffer, 47 webrtc::DesktopFrame* buffer,
48 const webrtc::DesktopRegion& region, 48 const webrtc::DesktopRegion& region,
49 const webrtc::DesktopRegion& shape) { 49 const webrtc::DesktopRegion* shape) {
50 DCHECK(jni_runtime_->display_task_runner()->BelongsToCurrentThread()); 50 DCHECK(jni_runtime_->display_task_runner()->BelongsToCurrentThread());
51 DCHECK(!shape);
51 52
52 if (bitmap_->size().width() != buffer->size().width() || 53 if (bitmap_->size().width() != buffer->size().width() ||
53 bitmap_->size().height() != buffer->size().height()) { 54 bitmap_->size().height() != buffer->size().height()) {
54 // Drop the frame, since the data belongs to the previous generation, 55 // Drop the frame, since the data belongs to the previous generation,
55 // before SetSourceSize() called SetOutputSizeAndClip(). 56 // before SetSourceSize() called SetOutputSizeAndClip().
56 FreeBuffer(buffer); 57 FreeBuffer(buffer);
57 return; 58 return;
58 } 59 }
59 60
60 // Copy pixels from |buffer| into the Java Bitmap. 61 // Copy pixels from |buffer| into the Java Bitmap.
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 126 }
126 127
127 void JniFrameConsumer::FreeBuffer(webrtc::DesktopFrame* buffer) { 128 void JniFrameConsumer::FreeBuffer(webrtc::DesktopFrame* buffer) {
128 DCHECK(std::find(buffers_.begin(), buffers_.end(), buffer) != buffers_.end()); 129 DCHECK(std::find(buffers_.begin(), buffers_.end(), buffer) != buffers_.end());
129 130
130 buffers_.remove(buffer); 131 buffers_.remove(buffer);
131 delete buffer; 132 delete buffer;
132 } 133 }
133 134
134 } // namespace remoting 135 } // namespace remoting
OLDNEW
« no previous file with comments | « remoting/client/jni/jni_frame_consumer.h ('k') | remoting/client/plugin/chromoting_instance.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698