| 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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 alphaType, colorSpace); | 49 alphaType, colorSpace); |
| 50 SkSurfaceProps disableLCDProps(0, kUnknown_SkPixelGeometry); | 50 SkSurfaceProps disableLCDProps(0, kUnknown_SkPixelGeometry); |
| 51 m_surface = | 51 m_surface = |
| 52 SkSurface::MakeRaster(info, Opaque == opacityMode ? 0 : &disableLCDProps); | 52 SkSurface::MakeRaster(info, Opaque == opacityMode ? 0 : &disableLCDProps); |
| 53 | 53 |
| 54 if (!m_surface) | 54 if (!m_surface) |
| 55 return; | 55 return; |
| 56 | 56 |
| 57 // Always save an initial frame, to support resetting the top level matrix | 57 // Always save an initial frame, to support resetting the top level matrix |
| 58 // and clip. | 58 // and clip. |
| 59 m_canvas = WTF::wrapUnique(new PaintCanvas(m_surface->getCanvas())); | 59 m_canvas = WTF::wrapUnique(new SkiaPaintCanvas(m_surface->getCanvas())); |
| 60 m_canvas->save(); | 60 m_canvas->save(); |
| 61 | 61 |
| 62 if (initializationMode == InitializeImagePixels) | 62 if (initializationMode == InitializeImagePixels) |
| 63 clear(); | 63 clear(); |
| 64 } | 64 } |
| 65 | 65 |
| 66 UnacceleratedImageBufferSurface::~UnacceleratedImageBufferSurface() {} | 66 UnacceleratedImageBufferSurface::~UnacceleratedImageBufferSurface() {} |
| 67 | 67 |
| 68 PaintCanvas* UnacceleratedImageBufferSurface::canvas() { | 68 PaintCanvas* UnacceleratedImageBufferSurface::canvas() { |
| 69 return m_canvas.get(); | 69 return m_canvas.get(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 bool UnacceleratedImageBufferSurface::isValid() const { | 72 bool UnacceleratedImageBufferSurface::isValid() const { |
| 73 return m_surface; | 73 return m_surface; |
| 74 } | 74 } |
| 75 | 75 |
| 76 sk_sp<SkImage> UnacceleratedImageBufferSurface::newImageSnapshot( | 76 sk_sp<SkImage> UnacceleratedImageBufferSurface::newImageSnapshot( |
| 77 AccelerationHint, | 77 AccelerationHint, |
| 78 SnapshotReason) { | 78 SnapshotReason) { |
| 79 return m_surface->makeImageSnapshot(); | 79 return m_surface->makeImageSnapshot(); |
| 80 } | 80 } |
| 81 | 81 |
| 82 } // namespace blink | 82 } // namespace blink |
| OLD | NEW |