| 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 { return m_canvas.get(); } | 56 PaintCanvas* canvas() override { |
| 57 return m_surface ? m_surface->getCanvas() : nullptr; |
| 58 } |
| 57 bool isValid() const override; | 59 bool isValid() const override; |
| 58 bool isAccelerated() const override { return true; } | 60 bool isAccelerated() const override { return true; } |
| 59 sk_sp<SkImage> newImageSnapshot(AccelerationHint, SnapshotReason) override; | 61 sk_sp<SkImage> newImageSnapshot(AccelerationHint, SnapshotReason) override; |
| 60 GLuint getBackingTextureHandleForOverwrite() override; | 62 GLuint getBackingTextureHandleForOverwrite() override; |
| 61 | 63 |
| 62 private: | 64 private: |
| 63 unsigned m_contextId; | 65 unsigned m_contextId; |
| 64 sk_sp<SkSurface> m_surface; // Uses m_contextProvider. | 66 sk_sp<PaintSurface> m_surface; // Uses m_contextProvider. |
| 65 std::unique_ptr<PaintCanvas> m_canvas; | |
| 66 }; | 67 }; |
| 67 | 68 |
| 68 } // namespace blink | 69 } // namespace blink |
| 69 | 70 |
| 70 #endif | 71 #endif |
| OLD | NEW |