| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 WTF_MAKE_NONCOPYABLE(AcceleratedImageBufferSurface); | 46 WTF_MAKE_NONCOPYABLE(AcceleratedImageBufferSurface); |
| 47 USING_FAST_MALLOC(AcceleratedImageBufferSurface); | 47 USING_FAST_MALLOC(AcceleratedImageBufferSurface); |
| 48 | 48 |
| 49 public: | 49 public: |
| 50 AcceleratedImageBufferSurface(const IntSize&, | 50 AcceleratedImageBufferSurface(const IntSize&, |
| 51 OpacityMode = NonOpaque, | 51 OpacityMode = NonOpaque, |
| 52 sk_sp<SkColorSpace> = nullptr, | 52 sk_sp<SkColorSpace> = nullptr, |
| 53 SkColorType = kN32_SkColorType); | 53 SkColorType = kN32_SkColorType); |
| 54 ~AcceleratedImageBufferSurface() override {} | 54 ~AcceleratedImageBufferSurface() override {} |
| 55 | 55 |
| 56 PaintCanvas* canvas() override { | 56 PaintCanvas* canvas() override { return m_canvas.get(); } |
| 57 return m_surface ? m_surface->getCanvas() : nullptr; | |
| 58 } | |
| 59 bool isValid() const override; | 57 bool isValid() const override; |
| 60 bool isAccelerated() const override { return true; } | 58 bool isAccelerated() const override { return true; } |
| 61 sk_sp<SkImage> newImageSnapshot(AccelerationHint, SnapshotReason) override; | 59 sk_sp<SkImage> newImageSnapshot(AccelerationHint, SnapshotReason) override; |
| 62 GLuint getBackingTextureHandleForOverwrite() override; | 60 GLuint getBackingTextureHandleForOverwrite() override; |
| 63 | 61 |
| 64 private: | 62 private: |
| 65 unsigned m_contextId; | 63 unsigned m_contextId; |
| 66 sk_sp<PaintSurface> m_surface; // Uses m_contextProvider. | 64 sk_sp<SkSurface> m_surface; // Uses m_contextProvider. |
| 65 std::unique_ptr<PaintCanvas> m_canvas; |
| 67 }; | 66 }; |
| 68 | 67 |
| 69 } // namespace blink | 68 } // namespace blink |
| 70 | 69 |
| 71 #endif | 70 #endif |
| OLD | NEW |