| 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 class WebGraphicsContext3DProvider; | 40 class WebGraphicsContext3DProvider; |
| 41 | 41 |
| 42 // This is a GPU backed surface that has no canvas or render target. | 42 // This is a GPU backed surface that has no canvas or render target. |
| 43 class PLATFORM_EXPORT WebGLImageBufferSurface : public ImageBufferSurface { | 43 class PLATFORM_EXPORT WebGLImageBufferSurface : public ImageBufferSurface { |
| 44 WTF_MAKE_NONCOPYABLE(WebGLImageBufferSurface); WTF_MAKE_FAST_ALLOCATED; | 44 WTF_MAKE_NONCOPYABLE(WebGLImageBufferSurface); WTF_MAKE_FAST_ALLOCATED; |
| 45 public: | 45 public: |
| 46 WebGLImageBufferSurface(const IntSize&, OpacityMode = NonOpaque); | 46 WebGLImageBufferSurface(const IntSize&, OpacityMode = NonOpaque); |
| 47 virtual ~WebGLImageBufferSurface(); | 47 virtual ~WebGLImageBufferSurface(); |
| 48 | 48 |
| 49 virtual SkCanvas* canvas() const OVERRIDE { return 0; } | 49 virtual SkCanvas* canvas() const override { return 0; } |
| 50 virtual const SkBitmap& bitmap() OVERRIDE { return m_bitmap; } | 50 virtual const SkBitmap& bitmap() override { return m_bitmap; } |
| 51 virtual bool isValid() const OVERRIDE { return m_bitmap.pixelRef(); } | 51 virtual bool isValid() const override { return m_bitmap.pixelRef(); } |
| 52 virtual bool isAccelerated() const OVERRIDE { return true; } | 52 virtual bool isAccelerated() const override { return true; } |
| 53 virtual Platform3DObject getBackingTexture() const OVERRIDE; | 53 virtual Platform3DObject getBackingTexture() const override; |
| 54 virtual void didModifyBackingTexture() OVERRIDE; | 54 virtual void didModifyBackingTexture() override; |
| 55 virtual bool cachedBitmapEnabled() const OVERRIDE { return true; } | 55 virtual bool cachedBitmapEnabled() const override { return true; } |
| 56 virtual const SkBitmap& cachedBitmap() const OVERRIDE { return m_cachedBitma
p; } | 56 virtual const SkBitmap& cachedBitmap() const override { return m_cachedBitma
p; } |
| 57 virtual void invalidateCachedBitmap() OVERRIDE; | 57 virtual void invalidateCachedBitmap() override; |
| 58 virtual void updateCachedBitmapIfNeeded() OVERRIDE; | 58 virtual void updateCachedBitmapIfNeeded() override; |
| 59 | 59 |
| 60 private: | 60 private: |
| 61 SkBitmap m_bitmap; | 61 SkBitmap m_bitmap; |
| 62 // This raw-pixel based SkBitmap works as a cache at CPU side to avoid heavy
cost | 62 // This raw-pixel based SkBitmap works as a cache at CPU side to avoid heavy
cost |
| 63 // on readback from GPU side to CPU side in some cases. | 63 // on readback from GPU side to CPU side in some cases. |
| 64 SkBitmap m_cachedBitmap; | 64 SkBitmap m_cachedBitmap; |
| 65 OwnPtr<WebGraphicsContext3DProvider> m_contextProvider; | 65 OwnPtr<WebGraphicsContext3DProvider> m_contextProvider; |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace blink | 68 } // namespace blink |
| 69 | 69 |
| 70 #endif | 70 #endif |
| OLD | NEW |