lint fix 📝

This commit is contained in:
Heilig Benedek 2017-04-12 20:54:03 +02:00
parent c54f7f2a8d
commit 3b94d268eb
3 changed files with 13 additions and 13 deletions

View file

@ -125,13 +125,13 @@ class AtomCopyFrameGenerator {
request->set_area(gfx::Rect(view_->GetPhysicalBackingSize())); request->set_area(gfx::Rect(view_->GetPhysicalBackingSize()));
view_->GetRootLayer()->RequestCopyOfOutput(std::move(request)); view_->GetRootLayer()->RequestCopyOfOutput(std::move(request));
} }
void set_frame_rate_threshold_us(int frame_rate_threshold_us) { void set_frame_rate_threshold_us(int frame_rate_threshold_us) {
frame_duration_ = base::TimeDelta::FromMicroseconds( frame_duration_ = base::TimeDelta::FromMicroseconds(
frame_rate_threshold_us); frame_rate_threshold_us);
} }
private: private:
void CopyFromCompositingSurfaceHasResult( void CopyFromCompositingSurfaceHasResult(
const gfx::Rect& damage_rect, const gfx::Rect& damage_rect,
std::unique_ptr<cc::CopyOutputResult> result) { std::unique_ptr<cc::CopyOutputResult> result) {
@ -140,22 +140,22 @@ private:
OnCopyFrameCaptureFailure(damage_rect); OnCopyFrameCaptureFailure(damage_rect);
return; return;
} }
DCHECK(result->HasBitmap()); DCHECK(result->HasBitmap());
std::unique_ptr<SkBitmap> source = result->TakeBitmap(); std::unique_ptr<SkBitmap> source = result->TakeBitmap();
DCHECK(source); DCHECK(source);
if (source) { if (source) {
base::AutoLock autolock(lock_); base::AutoLock autolock(lock_);
std::shared_ptr<SkBitmap> bitmap(source.release()); std::shared_ptr<SkBitmap> bitmap(source.release());
base::TimeTicks now = base::TimeTicks::Now(); base::TimeTicks now = base::TimeTicks::Now();
base::TimeDelta next_frame_in = next_frame_time_ - now; base::TimeDelta next_frame_in = next_frame_time_ - now;
if (next_frame_in > frame_duration_ / 4) { if (next_frame_in > frame_duration_ / 4) {
next_frame_time_ += frame_duration_; next_frame_time_ += frame_duration_;
content::BrowserThread::PostDelayedTask(content::BrowserThread::UI, content::BrowserThread::PostDelayedTask(content::BrowserThread::UI,
FROM_HERE, FROM_HERE,
base::Bind(&AtomCopyFrameGenerator::OnCopyFrameCaptureSuccess, base::Bind(&AtomCopyFrameGenerator::OnCopyFrameCaptureSuccess,
weak_ptr_factory_.GetWeakPtr(), weak_ptr_factory_.GetWeakPtr(),
damage_rect, damage_rect,
bitmap), bitmap),
next_frame_in); next_frame_in);
@ -163,7 +163,7 @@ private:
next_frame_time_ = now + frame_duration_; next_frame_time_ = now + frame_duration_;
OnCopyFrameCaptureSuccess(damage_rect, bitmap); OnCopyFrameCaptureSuccess(damage_rect, bitmap);
} }
frame_retry_count_ = 0; frame_retry_count_ = 0;
} else { } else {
OnCopyFrameCaptureFailure(damage_rect); OnCopyFrameCaptureFailure(damage_rect);
@ -187,7 +187,7 @@ private:
base::AutoLock lock(onPaintLock_); base::AutoLock lock(onPaintLock_);
view_->OnPaint(damage_rect, *bitmap); view_->OnPaint(damage_rect, *bitmap);
} }
base::Lock lock_; base::Lock lock_;
base::Lock onPaintLock_; base::Lock onPaintLock_;
OffScreenRenderWidgetHostView* view_; OffScreenRenderWidgetHostView* view_;
@ -927,10 +927,10 @@ void OffScreenRenderWidgetHostView::OnPaint(
gfx::Rect pos = popup_host_view_->popup_position_; gfx::Rect pos = popup_host_view_->popup_position_;
gfx::Rect damage(damage_rect); gfx::Rect damage(damage_rect);
damage.Union(pos); damage.Union(pos);
SkBitmap copy = SkBitmapOperations::CreateTiledBitmap(bitmap, SkBitmap copy = SkBitmapOperations::CreateTiledBitmap(bitmap,
pos.x(), pos.y(), pos.width(), pos.height()); pos.x(), pos.y(), pos.width(), pos.height());
CopyBitmapTo(bitmap, *popup_bitmap_, pos); CopyBitmapTo(bitmap, *popup_bitmap_, pos);
callback_.Run(damage, bitmap); callback_.Run(damage, bitmap);
CopyBitmapTo(bitmap, copy, pos); CopyBitmapTo(bitmap, copy, pos);

View file

@ -30,7 +30,7 @@ OffScreenWebContentsView::~OffScreenWebContentsView() {
void OffScreenWebContentsView::SetWebContents( void OffScreenWebContentsView::SetWebContents(
content::WebContents* web_contents) { content::WebContents* web_contents) {
web_contents_ = web_contents; web_contents_ = web_contents;
RenderViewCreated(web_contents_->GetRenderViewHost()); RenderViewCreated(web_contents_->GetRenderViewHost());
} }
@ -141,7 +141,7 @@ void OffScreenWebContentsView::SetOverscrollControllerEnabled(bool enabled) {
} }
void OffScreenWebContentsView::GetScreenInfo( void OffScreenWebContentsView::GetScreenInfo(
content::ScreenInfo* screen_info) const { content::ScreenInfo* screen_info) const {
screen_info->depth = 24; screen_info->depth = 24;
screen_info->depth_per_component = 8; screen_info->depth_per_component = 8;
screen_info->orientation_angle = 0; screen_info->orientation_angle = 0;

View file

@ -359,7 +359,7 @@ mate::Handle<NativeImage> NativeImage::Resize(
bool width_set = options.GetInteger("width", &width); bool width_set = options.GetInteger("width", &width);
bool height_set = options.GetInteger("height", &height); bool height_set = options.GetInteger("height", &height);
size.SetSize(width, height); size.SetSize(width, height);
isolate_->AdjustAmountOfExternalAllocatedMemory( isolate_->AdjustAmountOfExternalAllocatedMemory(
(width_set * height_set - width * height) * 4); (width_set * height_set - width * height) * 4);