OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2013, Google Inc. All rights reserved. | 2 * Copyright (c) 2013, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 17 matching lines...) Expand all Loading... |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "config.h" | 31 #include "config.h" |
32 | 32 |
33 #include "platform/graphics/ImageBufferSurface.h" | 33 #include "platform/graphics/ImageBufferSurface.h" |
34 | 34 |
35 #include "platform/graphics/ImageBuffer.h" | 35 #include "platform/graphics/ImageBuffer.h" |
36 #include "third_party/skia/include/core/SkCanvas.h" | 36 #include "third_party/skia/include/core/SkCanvas.h" |
37 #include "third_party/skia/include/core/SkDevice.h" | 37 #include "third_party/skia/include/core/SkDevice.h" |
| 38 #include "third_party/skia/include/core/SkImage.h" |
38 #include "third_party/skia/include/core/SkPicture.h" | 39 #include "third_party/skia/include/core/SkPicture.h" |
39 | 40 |
40 namespace blink { | 41 namespace blink { |
41 | 42 |
42 ImageBufferSurface::ImageBufferSurface(const IntSize& size, OpacityMode opacityM
ode) | 43 ImageBufferSurface::ImageBufferSurface(const IntSize& size, OpacityMode opacityM
ode) |
43 : m_opacityMode(opacityMode) | 44 : m_opacityMode(opacityMode) |
44 , m_size(size) | 45 , m_size(size) |
45 { | 46 { |
46 setIsHidden(false); | 47 setIsHidden(false); |
47 } | 48 } |
48 | 49 |
| 50 ImageBufferSurface::~ImageBufferSurface() { } |
| 51 |
49 PassRefPtr<SkPicture> ImageBufferSurface::getPicture() | 52 PassRefPtr<SkPicture> ImageBufferSurface::getPicture() |
50 { | 53 { |
51 return nullptr; | 54 return nullptr; |
52 } | 55 } |
53 | 56 |
54 void ImageBufferSurface::clear() | 57 void ImageBufferSurface::clear() |
55 { | 58 { |
56 // Clear the background transparent or opaque, as required. It would be nice
if this wasn't | 59 // Clear the background transparent or opaque, as required. It would be nice
if this wasn't |
57 // required, but the canvas is currently filled with the magic transparency | 60 // required, but the canvas is currently filled with the magic transparency |
58 // color. Can we have another way to manage this? | 61 // color. Can we have another way to manage this? |
(...skipping 12 matching lines...) Expand all Loading... |
71 willAccessPixels(); | 74 willAccessPixels(); |
72 return canvas()->getTopDevice()->accessBitmap(false); | 75 return canvas()->getTopDevice()->accessBitmap(false); |
73 } | 76 } |
74 | 77 |
75 const SkBitmap& ImageBufferSurface::cachedBitmap() const | 78 const SkBitmap& ImageBufferSurface::cachedBitmap() const |
76 { | 79 { |
77 DEFINE_STATIC_LOCAL(SkBitmap, nullBitmap, ()); | 80 DEFINE_STATIC_LOCAL(SkBitmap, nullBitmap, ()); |
78 return nullBitmap; | 81 return nullBitmap; |
79 } | 82 } |
80 | 83 |
| 84 PassRefPtr<SkImage> ImageBufferSurface::newImageSnapshot() const |
| 85 { |
| 86 return nullptr; |
| 87 } |
| 88 |
81 } // namespace blink | 89 } // namespace blink |
OLD | NEW |