| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 | 89 |
| 90 // Like flush, but flushes all the way down to the GPU context if the surface | 90 // Like flush, but flushes all the way down to the GPU context if the surface |
| 91 // uses the GPU. | 91 // uses the GPU. |
| 92 virtual void FlushGpu(FlushReason reason) { Flush(reason); } | 92 virtual void FlushGpu(FlushReason reason) { Flush(reason); } |
| 93 | 93 |
| 94 virtual void PrepareSurfaceForPaintingIfNeeded() {} | 94 virtual void PrepareSurfaceForPaintingIfNeeded() {} |
| 95 virtual bool WritePixels(const SkImageInfo& orig_info, | 95 virtual bool WritePixels(const SkImageInfo& orig_info, |
| 96 const void* pixels, | 96 const void* pixels, |
| 97 size_t row_bytes, | 97 size_t row_bytes, |
| 98 int x, | 98 int x, |
| 99 int y); | 99 int y) = 0; |
| 100 | 100 |
| 101 // May return nullptr if the surface is GPU-backed and the GPU context was | 101 // May return nullptr if the surface is GPU-backed and the GPU context was |
| 102 // lost. | 102 // lost. |
| 103 virtual sk_sp<SkImage> NewImageSnapshot(AccelerationHint, SnapshotReason) = 0; | 103 virtual sk_sp<SkImage> NewImageSnapshot(AccelerationHint, SnapshotReason) = 0; |
| 104 | 104 |
| 105 OpacityMode GetOpacityMode() const { return opacity_mode_; } | 105 OpacityMode GetOpacityMode() const { return opacity_mode_; } |
| 106 const IntSize& size() const { return size_; } | 106 const IntSize& size() const { return size_; } |
| 107 const CanvasColorParams& color_params() const { return color_params_; } | 107 const CanvasColorParams& color_params() const { return color_params_; } |
| 108 void NotifyIsValidChanged(bool is_valid) const; | 108 void NotifyIsValidChanged(bool is_valid) const; |
| 109 | 109 |
| 110 protected: | 110 protected: |
| 111 ImageBufferSurface(const IntSize&, OpacityMode, const CanvasColorParams&); | 111 ImageBufferSurface(const IntSize&, OpacityMode, const CanvasColorParams&); |
| 112 void Clear(); | 112 void Clear(); |
| 113 | 113 |
| 114 private: | 114 private: |
| 115 OpacityMode opacity_mode_; | 115 OpacityMode opacity_mode_; |
| 116 IntSize size_; | 116 IntSize size_; |
| 117 CanvasColorParams color_params_; | 117 CanvasColorParams color_params_; |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 } // namespace blink | 120 } // namespace blink |
| 121 | 121 |
| 122 #endif | 122 #endif |
| OLD | NEW |