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

Unified Diff: webrtc/modules/desktop_capture/desktop_frame_win.cc

Issue 1845113002: DirectX based screen capturer logic (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Remove width change in Texture::Capture Created 4 years, 8 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: webrtc/modules/desktop_capture/desktop_frame_win.cc
diff --git a/webrtc/modules/desktop_capture/desktop_frame_win.cc b/webrtc/modules/desktop_capture/desktop_frame_win.cc
index f139fb5cddf2bb7ea2b71a668fddb940b23441c0..2b4478fdfc219fc44d7cacdb804ef94187cf3df6 100644
--- a/webrtc/modules/desktop_capture/desktop_frame_win.cc
+++ b/webrtc/modules/desktop_capture/desktop_frame_win.cc
@@ -10,6 +10,7 @@
#include "webrtc/modules/desktop_capture/desktop_frame_win.h"
+#include <assert.h>
#include <utility>
#include "webrtc/system_wrappers/include/logging.h"
@@ -34,7 +35,7 @@ DesktopFrameWin* DesktopFrameWin::Create(
DesktopSize size,
SharedMemoryFactory* shared_memory_factory,
HDC hdc) {
- int bytes_per_row = size.width() * kBytesPerPixel;
+ int bytes_per_row = size.width() * DesktopFrame::kBytesPerPixel;
Sergey Ulanov 2016/04/14 23:10:42 This class inherits from DesktopFrame, so we don't
Hzj_jie 2016/04/15 19:42:17 Sorry, changes to this file and its header file sh
int buffer_size = bytes_per_row * size.height();
// Describe a device independent bitmap (DIB) that is the size of the desktop.
@@ -42,9 +43,9 @@ DesktopFrameWin* DesktopFrameWin::Create(
bmi.bmiHeader.biHeight = -size.height();
bmi.bmiHeader.biWidth = size.width();
bmi.bmiHeader.biPlanes = 1;
- bmi.bmiHeader.biBitCount = DesktopFrameWin::kBytesPerPixel * 8;
+ bmi.bmiHeader.biBitCount = DesktopFrame::kBytesPerPixel * 8;
bmi.bmiHeader.biSize = sizeof(bmi.bmiHeader);
- bmi.bmiHeader.biSizeImage = bytes_per_row * size.height();
+ bmi.bmiHeader.biSizeImage = buffer_size;
std::unique_ptr<SharedMemory> shared_memory;
HANDLE section_handle = nullptr;

Powered by Google App Engine
This is Rietveld 408576698