| 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 "content/public/browser/browser_thread.h" | 7 #include "content/public/browser/browser_thread.h" |
| 8 #include "third_party/skia/include/core/SkBitmap.h" | 8 #include "third_party/skia/include/core/SkBitmap.h" |
| 9 #include "third_party/skia/include/core/SkDevice.h" | 9 #include "third_party/skia/include/core/SkDevice.h" |
| 10 #include "ui/compositor/compositor.h" | 10 #include "ui/compositor/compositor.h" |
| 11 #include "ui/gfx/canvas.h" | 11 #include "ui/gfx/canvas.h" |
| 12 #include "ui/gfx/canvas_skia_paint.h" | |
| 13 #include "ui/gfx/gdi_util.h" | 12 #include "ui/gfx/gdi_util.h" |
| 14 #include "ui/gfx/skia_util.h" | 13 #include "ui/gfx/skia_util.h" |
| 15 | 14 |
| 16 namespace content { | 15 namespace content { |
| 17 | 16 |
| 18 SoftwareOutputDeviceWin::SoftwareOutputDeviceWin(ui::Compositor* compositor) | 17 SoftwareOutputDeviceWin::SoftwareOutputDeviceWin(ui::Compositor* compositor) |
| 19 : hwnd_(compositor->widget()), | 18 : hwnd_(compositor->widget()), |
| 20 is_hwnd_composited_(false) { | 19 is_hwnd_composited_(false) { |
| 21 // TODO(skaslev) Remove this when crbug.com/180702 is fixed. | 20 // TODO(skaslev) Remove this when crbug.com/180702 is fixed. |
| 22 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 21 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 98 | 97 |
| 99 void SoftwareOutputDeviceWin::CopyToPixels(const gfx::Rect& rect, | 98 void SoftwareOutputDeviceWin::CopyToPixels(const gfx::Rect& rect, |
| 100 void* pixels) { | 99 void* pixels) { |
| 101 DCHECK(contents_); | 100 DCHECK(contents_); |
| 102 SkImageInfo info = SkImageInfo::MakeN32Premul(rect.width(), rect.height()); | 101 SkImageInfo info = SkImageInfo::MakeN32Premul(rect.width(), rect.height()); |
| 103 contents_->sk_canvas()->readPixels( | 102 contents_->sk_canvas()->readPixels( |
| 104 info, pixels, info.minRowBytes(), rect.x(), rect.y()); | 103 info, pixels, info.minRowBytes(), rect.x(), rect.y()); |
| 105 } | 104 } |
| 106 | 105 |
| 107 } // namespace content | 106 } // namespace content |
| OLD | NEW |