OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "chrome/browser/renderer_host/backing_store_mac.h" | 7 #include "chrome/browser/renderer_host/backing_store_mac.h" |
8 | 8 |
9 #include "app/surface/transport_dib.h" | 9 #include "app/surface/transport_dib.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
11 #include "base/mac/mac_util.h" | 11 #include "base/mac/mac_util.h" |
12 #include "base/mac/scoped_cftyperef.h" | 12 #include "base/mac/scoped_cftyperef.h" |
13 #include "base/sys_info.h" | 13 #include "base/sys_info.h" |
14 #include "chrome/browser/renderer_host/render_process_host.h" | 14 #include "chrome/browser/renderer_host/render_process_host.h" |
15 #include "chrome/browser/renderer_host/render_widget_host.h" | 15 #include "chrome/browser/renderer_host/render_widget_host.h" |
16 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 16 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
17 #include "gfx/rect.h" | |
18 #include "skia/ext/platform_canvas.h" | 17 #include "skia/ext/platform_canvas.h" |
19 #include "third_party/skia/include/core/SkBitmap.h" | 18 #include "third_party/skia/include/core/SkBitmap.h" |
20 #include "third_party/skia/include/core/SkCanvas.h" | 19 #include "third_party/skia/include/core/SkCanvas.h" |
| 20 #include "ui/gfx/rect.h" |
21 | 21 |
22 // Mac Backing Stores: | 22 // Mac Backing Stores: |
23 // | 23 // |
24 // Since backing stores are only ever written to or drawn into windows, we keep | 24 // Since backing stores are only ever written to or drawn into windows, we keep |
25 // our backing store in a CGLayer that can get cached in GPU memory. This | 25 // our backing store in a CGLayer that can get cached in GPU memory. This |
26 // allows acclerated drawing into the layer and lets scrolling and such happen | 26 // allows acclerated drawing into the layer and lets scrolling and such happen |
27 // all or mostly on the GPU, which is good for performance. | 27 // all or mostly on the GPU, which is good for performance. |
28 | 28 |
29 namespace { | 29 namespace { |
30 | 30 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 CGContextRef context = CGBitmapContextCreate(NULL, | 233 CGContextRef context = CGBitmapContextCreate(NULL, |
234 size().width(), size().height(), | 234 size().width(), size().height(), |
235 8, size().width() * 4, | 235 8, size().width() * 4, |
236 base::mac::GetSystemColorSpace(), | 236 base::mac::GetSystemColorSpace(), |
237 kCGImageAlphaPremultipliedFirst | | 237 kCGImageAlphaPremultipliedFirst | |
238 kCGBitmapByteOrder32Host); | 238 kCGBitmapByteOrder32Host); |
239 DCHECK(context); | 239 DCHECK(context); |
240 | 240 |
241 return context; | 241 return context; |
242 } | 242 } |
OLD | NEW |