| 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 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 virtual void setFilterQuality(SkFilterQuality) { } | 75 virtual void setFilterQuality(SkFilterQuality) { } |
| 76 virtual void setIsHidden(bool) { } | 76 virtual void setIsHidden(bool) { } |
| 77 virtual void setImageBuffer(ImageBuffer*) { } | 77 virtual void setImageBuffer(ImageBuffer*) { } |
| 78 virtual PassRefPtr<SkPicture> getPicture(); | 78 virtual PassRefPtr<SkPicture> getPicture(); |
| 79 virtual void finalizeFrame(const FloatRect &dirtyRect) { } | 79 virtual void finalizeFrame(const FloatRect &dirtyRect) { } |
| 80 virtual void willDrawVideo() { } | 80 virtual void willDrawVideo() { } |
| 81 virtual void willOverwriteCanvas() { } | 81 virtual void willOverwriteCanvas() { } |
| 82 virtual void draw(GraphicsContext*, const FloatRect& destRect, const FloatRe
ct& srcRect, SkXfermode::Mode); | 82 virtual void draw(GraphicsContext*, const FloatRect& destRect, const FloatRe
ct& srcRect, SkXfermode::Mode); |
| 83 virtual void setHasExpensiveOp() { } | 83 virtual void setHasExpensiveOp() { } |
| 84 | 84 |
| 85 // These methods return an SkImage representing the backing texture. We supp
ort both variants | 85 // May return nullptr if the surface is GPU-backed and the GPU context was l
ost. |
| 86 // to avoid the snapshot overhead (flushing deferred draws, COW semantics, f
allback in | 86 virtual PassRefPtr<SkImage> newImageSnapshot() const = 0; |
| 87 // RecordingImageBufferSurface) when not strictly required. | |
| 88 virtual PassRefPtr<SkImage> newImageSnapshot() const { return nullptr; } | |
| 89 virtual PassRefPtr<SkImage> getBackingTextureImage() const { return nullptr;
} | |
| 90 | 87 |
| 91 OpacityMode opacityMode() const { return m_opacityMode; } | 88 OpacityMode opacityMode() const { return m_opacityMode; } |
| 92 const IntSize& size() const { return m_size; } | 89 const IntSize& size() const { return m_size; } |
| 93 void notifyIsValidChanged(bool isValid) const; | 90 void notifyIsValidChanged(bool isValid) const; |
| 94 | 91 |
| 95 protected: | 92 protected: |
| 96 ImageBufferSurface(const IntSize&, OpacityMode); | 93 ImageBufferSurface(const IntSize&, OpacityMode); |
| 97 void clear(); | 94 void clear(); |
| 98 | 95 |
| 99 private: | 96 private: |
| 100 OpacityMode m_opacityMode; | 97 OpacityMode m_opacityMode; |
| 101 IntSize m_size; | 98 IntSize m_size; |
| 102 }; | 99 }; |
| 103 | 100 |
| 104 } // namespace blink | 101 } // namespace blink |
| 105 | 102 |
| 106 #endif | 103 #endif |
| OLD | NEW |