OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "content/browser/compositor/software_output_device_win.h" | 5 #include "content/browser/compositor/software_output_device_win.h" |
6 | 6 |
7 #include "base/debug/alias.h" | 7 #include "base/debug/alias.h" |
8 #include "base/memory/shared_memory.h" | 8 #include "base/memory/shared_memory.h" |
9 #include "cc/resources/shared_bitmap.h" | 9 #include "cc/resources/shared_bitmap.h" |
10 #include "content/public/browser/browser_thread.h" | 10 #include "content/public/browser/browser_thread.h" |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
107 DCHECK(!in_paint_); | 107 DCHECK(!in_paint_); |
108 if (backing_) | 108 if (backing_) |
109 backing_->UnregisterOutputDevice(this); | 109 backing_->UnregisterOutputDevice(this); |
110 } | 110 } |
111 | 111 |
112 void SoftwareOutputDeviceWin::Resize(const gfx::Size& viewport_pixel_size, | 112 void SoftwareOutputDeviceWin::Resize(const gfx::Size& viewport_pixel_size, |
113 float scale_factor) { | 113 float scale_factor) { |
114 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 114 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
115 DCHECK(!in_paint_); | 115 DCHECK(!in_paint_); |
116 | 116 |
117 scale_factor_ = scale_factor; | |
118 | |
119 if (viewport_pixel_size_ == viewport_pixel_size) | 117 if (viewport_pixel_size_ == viewport_pixel_size) |
120 return; | 118 return; |
121 | 119 |
122 viewport_pixel_size_ = viewport_pixel_size; | 120 viewport_pixel_size_ = viewport_pixel_size; |
123 if (backing_) | 121 if (backing_) |
124 backing_->Resized(); | 122 backing_->Resized(); |
125 contents_.reset(); | 123 contents_.reset(); |
126 } | 124 } |
127 | 125 |
128 SkCanvas* SoftwareOutputDeviceWin::BeginPaint(const gfx::Rect& damage_rect) { | 126 SkCanvas* SoftwareOutputDeviceWin::BeginPaint(const gfx::Rect& damage_rect) { |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 } | 191 } |
194 } | 192 } |
195 | 193 |
196 void SoftwareOutputDeviceWin::ReleaseContents() { | 194 void SoftwareOutputDeviceWin::ReleaseContents() { |
197 DCHECK(!contents_ || contents_->unique()); | 195 DCHECK(!contents_ || contents_->unique()); |
198 DCHECK(!in_paint_); | 196 DCHECK(!in_paint_); |
199 contents_.reset(); | 197 contents_.reset(); |
200 } | 198 } |
201 | 199 |
202 } // namespace content | 200 } // namespace content |
OLD | NEW |