| 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 #ifndef CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_MAC_H_ | 5 #ifndef CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_MAC_H_ |
| 6 #define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_MAC_H_ | 6 #define CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_MAC_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/mac/scoped_cftyperef.h" | 10 #include "base/mac/scoped_cftyperef.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 // A CGBitmapContext that stores the contents of the backing store if the | 22 // A CGBitmapContext that stores the contents of the backing store if the |
| 23 // corresponding Cocoa view has not been inserted into an NSWindow yet. | 23 // corresponding Cocoa view has not been inserted into an NSWindow yet. |
| 24 CGContextRef cg_bitmap() { return cg_bitmap_; } | 24 CGContextRef cg_bitmap() { return cg_bitmap_; } |
| 25 | 25 |
| 26 // BackingStore implementation. | 26 // BackingStore implementation. |
| 27 virtual void PaintToBackingStore( | 27 virtual void PaintToBackingStore( |
| 28 RenderProcessHost* process, | 28 RenderProcessHost* process, |
| 29 TransportDIB::Id bitmap, | 29 TransportDIB::Id bitmap, |
| 30 const gfx::Rect& bitmap_rect, | 30 const gfx::Rect& bitmap_rect, |
| 31 const std::vector<gfx::Rect>& copy_rects, | 31 const std::vector<gfx::Rect>& copy_rects); |
| 32 bool* painted_synchronously); | |
| 33 virtual bool CopyFromBackingStore(const gfx::Rect& rect, | 32 virtual bool CopyFromBackingStore(const gfx::Rect& rect, |
| 34 skia::PlatformCanvas* output); | 33 skia::PlatformCanvas* output); |
| 35 virtual void ScrollBackingStore(int dx, int dy, | 34 virtual void ScrollBackingStore(int dx, int dy, |
| 36 const gfx::Rect& clip_rect, | 35 const gfx::Rect& clip_rect, |
| 37 const gfx::Size& view_size); | 36 const gfx::Size& view_size); |
| 38 | 37 |
| 39 private: | 38 private: |
| 40 // Creates a CGLayer associated with its owner view's window's graphics | 39 // Creates a CGLayer associated with its owner view's window's graphics |
| 41 // context, sized properly for the backing store. Returns NULL if the owner | 40 // context, sized properly for the backing store. Returns NULL if the owner |
| 42 // is not in a window with a CGContext. cg_layer_ is assigned this method's | 41 // is not in a window with a CGContext. cg_layer_ is assigned this method's |
| 43 // result. | 42 // result. |
| 44 CGLayerRef CreateCGLayer(); | 43 CGLayerRef CreateCGLayer(); |
| 45 | 44 |
| 46 // Creates a CGBitmapContext sized properly for the backing store. The | 45 // Creates a CGBitmapContext sized properly for the backing store. The |
| 47 // owner view need not be in a window. cg_bitmap_ is assigned this method's | 46 // owner view need not be in a window. cg_bitmap_ is assigned this method's |
| 48 // result. | 47 // result. |
| 49 CGContextRef CreateCGBitmapContext(); | 48 CGContextRef CreateCGBitmapContext(); |
| 50 | 49 |
| 51 base::mac::ScopedCFTypeRef<CGContextRef> cg_bitmap_; | 50 base::mac::ScopedCFTypeRef<CGContextRef> cg_bitmap_; |
| 52 base::mac::ScopedCFTypeRef<CGLayerRef> cg_layer_; | 51 base::mac::ScopedCFTypeRef<CGLayerRef> cg_layer_; |
| 53 | 52 |
| 54 DISALLOW_COPY_AND_ASSIGN(BackingStoreMac); | 53 DISALLOW_COPY_AND_ASSIGN(BackingStoreMac); |
| 55 }; | 54 }; |
| 56 | 55 |
| 57 #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_MAC_H_ | 56 #endif // CHROME_BROWSER_RENDERER_HOST_BACKING_STORE_MAC_H_ |
| OLD | NEW |