format previously missed chromium_src .cc files
This commit is contained in:
parent
8cc81509d7
commit
f7d4437b3f
58 changed files with 688 additions and 898 deletions
|
@ -20,8 +20,8 @@ using base::PlatformThreadRef;
|
|||
#include "media/base/video_util.h"
|
||||
#include "third_party/libyuv/include/libyuv/scale_argb.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
|
||||
#include "third_party/webrtc/modules/desktop_capture/desktop_capturer.h"
|
||||
#include "third_party/webrtc/modules/desktop_capture/desktop_frame.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/gfx/skia_util.h"
|
||||
|
||||
|
@ -50,9 +50,8 @@ gfx::ImageSkia ScaleDesktopFrame(std::unique_ptr<webrtc::DesktopFrame> frame,
|
|||
result.allocN32Pixels(scaled_rect.width(), scaled_rect.height(), true);
|
||||
|
||||
uint8* pixels_data = reinterpret_cast<uint8*>(result.getPixels());
|
||||
libyuv::ARGBScale(frame->data(), frame->stride(),
|
||||
frame->size().width(), frame->size().height(),
|
||||
pixels_data, result.rowBytes(),
|
||||
libyuv::ARGBScale(frame->data(), frame->stride(), frame->size().width(),
|
||||
frame->size().height(), pixels_data, result.rowBytes(),
|
||||
scaled_rect.width(), scaled_rect.height(),
|
||||
libyuv::kFilterBilinear);
|
||||
|
||||
|
@ -76,9 +75,7 @@ gfx::ImageSkia ScaleDesktopFrame(std::unique_ptr<webrtc::DesktopFrame> frame,
|
|||
NativeDesktopMediaList::SourceDescription::SourceDescription(
|
||||
DesktopMediaID id,
|
||||
const base::string16& name)
|
||||
: id(id),
|
||||
name(name) {
|
||||
}
|
||||
: id(id), name(name) {}
|
||||
|
||||
class NativeDesktopMediaList::Worker
|
||||
: public webrtc::DesktopCapturer::Callback {
|
||||
|
@ -137,12 +134,12 @@ void NativeDesktopMediaList::Worker::Refresh(
|
|||
base::string16 title;
|
||||
for (size_t i = 0; i < screens.size(); ++i) {
|
||||
if (mutiple_screens) {
|
||||
title = base::UTF8ToUTF16("Screen " + base::IntToString(i+1));
|
||||
title = base::UTF8ToUTF16("Screen " + base::IntToString(i + 1));
|
||||
} else {
|
||||
title = base::UTF8ToUTF16("Entire screen");
|
||||
}
|
||||
sources.push_back(SourceDescription(DesktopMediaID(
|
||||
DesktopMediaID::TYPE_SCREEN, screens[i].id), title));
|
||||
sources.push_back(SourceDescription(
|
||||
DesktopMediaID(DesktopMediaID::TYPE_SCREEN, screens[i].id), title));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -163,8 +160,7 @@ void NativeDesktopMediaList::Worker::Refresh(
|
|||
// Update list of windows before updating thumbnails.
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(&NativeDesktopMediaList::OnSourcesList,
|
||||
media_list_, sources));
|
||||
base::Bind(&NativeDesktopMediaList::OnSourcesList, media_list_, sources));
|
||||
|
||||
ImageHashesMap new_image_hashes;
|
||||
|
||||
|
@ -202,8 +198,8 @@ void NativeDesktopMediaList::Worker::Refresh(
|
|||
ScaleDesktopFrame(std::move(current_frame_), thumbnail_size);
|
||||
BrowserThread::PostTask(
|
||||
BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(&NativeDesktopMediaList::OnSourceThumbnail,
|
||||
media_list_, i, thumbnail));
|
||||
base::Bind(&NativeDesktopMediaList::OnSourceThumbnail, media_list_,
|
||||
i, thumbnail));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -248,8 +244,7 @@ void NativeDesktopMediaList::SetUpdatePeriod(base::TimeDelta period) {
|
|||
update_period_ = period;
|
||||
}
|
||||
|
||||
void NativeDesktopMediaList::SetThumbnailSize(
|
||||
const gfx::Size& thumbnail_size) {
|
||||
void NativeDesktopMediaList::SetThumbnailSize(const gfx::Size& thumbnail_size) {
|
||||
thumbnail_size_ = thumbnail_size;
|
||||
}
|
||||
|
||||
|
@ -279,7 +274,8 @@ const DesktopMediaList::Source& NativeDesktopMediaList::GetSource(
|
|||
return sources_[index];
|
||||
}
|
||||
|
||||
std::vector<DesktopMediaList::Source> NativeDesktopMediaList::GetSources() const {
|
||||
std::vector<DesktopMediaList::Source> NativeDesktopMediaList::GetSources()
|
||||
const {
|
||||
return sources_;
|
||||
}
|
||||
|
||||
|
@ -351,9 +347,8 @@ void NativeDesktopMediaList::OnSourcesList(
|
|||
}
|
||||
}
|
||||
|
||||
void NativeDesktopMediaList::OnSourceThumbnail(
|
||||
int index,
|
||||
const gfx::ImageSkia& image) {
|
||||
void NativeDesktopMediaList::OnSourceThumbnail(int index,
|
||||
const gfx::ImageSkia& image) {
|
||||
DCHECK_LT(index, static_cast<int>(sources_.size()));
|
||||
sources_[index].thumbnail = image;
|
||||
observer_->OnSourceThumbnailChanged(index);
|
||||
|
@ -363,10 +358,9 @@ void NativeDesktopMediaList::OnRefreshFinished() {
|
|||
// Give a chance to the observer to stop the refresh work.
|
||||
bool is_continue = observer_->OnRefreshFinished();
|
||||
if (is_continue) {
|
||||
BrowserThread::PostDelayedTask(
|
||||
BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(&NativeDesktopMediaList::Refresh,
|
||||
weak_factory_.GetWeakPtr()),
|
||||
update_period_);
|
||||
BrowserThread::PostDelayedTask(BrowserThread::UI, FROM_HERE,
|
||||
base::Bind(&NativeDesktopMediaList::Refresh,
|
||||
weak_factory_.GetWeakPtr()),
|
||||
update_period_);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue