| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef SkiaTextureHolder_h | 5 #ifndef SkiaTextureHolder_h |
| 6 #define SkiaTextureHolder_h | 6 #define SkiaTextureHolder_h |
| 7 | 7 |
| 8 #include "platform/PlatformExport.h" | 8 #include "platform/PlatformExport.h" |
| 9 #include "platform/graphics/TextureHolder.h" | 9 #include "platform/graphics/TextureHolder.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class PLATFORM_EXPORT SkiaTextureHolder final : public TextureHolder { | 13 class PLATFORM_EXPORT SkiaTextureHolder final : public TextureHolder { |
| 14 public: | 14 public: |
| 15 ~SkiaTextureHolder() override; | 15 ~SkiaTextureHolder() override; |
| 16 | 16 |
| 17 // Methods overriding TextureHolder |
| 18 void updateSyncToken(gpu::SyncToken) override {} |
| 19 |
| 17 bool isSkiaTextureHolder() final { return true; } | 20 bool isSkiaTextureHolder() final { return true; } |
| 18 bool isMailboxTextureHolder() final { return false; } | 21 bool isMailboxTextureHolder() final { return false; } |
| 19 unsigned sharedContextId() final; | 22 unsigned sharedContextId() final; |
| 20 IntSize size() const final { | 23 IntSize size() const final { |
| 21 return IntSize(m_image->width(), m_image->height()); | 24 return IntSize(m_image->width(), m_image->height()); |
| 22 } | 25 } |
| 23 bool currentFrameKnownToBeOpaque(Image::MetadataMode) final { | 26 bool currentFrameKnownToBeOpaque(Image::MetadataMode) final { |
| 24 return m_image->isOpaque(); | 27 return m_image->isOpaque(); |
| 25 } | 28 } |
| 26 | 29 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 41 | 44 |
| 42 // The m_image should always be texture-backed | 45 // The m_image should always be texture-backed |
| 43 sk_sp<SkImage> m_image; | 46 sk_sp<SkImage> m_image; |
| 44 // Id of the shared context where m_image was created | 47 // Id of the shared context where m_image was created |
| 45 unsigned m_sharedContextId = 0; | 48 unsigned m_sharedContextId = 0; |
| 46 }; | 49 }; |
| 47 | 50 |
| 48 } // namespace blink | 51 } // namespace blink |
| 49 | 52 |
| 50 #endif // SkiaTextureHolder_h | 53 #endif // SkiaTextureHolder_h |
| OLD | NEW |