| 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 25 matching lines...) Expand all  Loading... | 
| 36 #include "public/platform/Platform.h" | 36 #include "public/platform/Platform.h" | 
| 37 #include "public/platform/WebGraphicsContext3DProvider.h" | 37 #include "public/platform/WebGraphicsContext3DProvider.h" | 
| 38 #include "third_party/skia/include/core/SkPixelRef.h" | 38 #include "third_party/skia/include/core/SkPixelRef.h" | 
| 39 #include "wtf/PassOwnPtr.h" | 39 #include "wtf/PassOwnPtr.h" | 
| 40 | 40 | 
| 41 namespace blink { | 41 namespace blink { | 
| 42 | 42 | 
| 43 WebGLImageBufferSurface::WebGLImageBufferSurface(const IntSize& size, OpacityMod
    e opacityMode) | 43 WebGLImageBufferSurface::WebGLImageBufferSurface(const IntSize& size, OpacityMod
    e opacityMode) | 
| 44     : ImageBufferSurface(size, opacityMode) | 44     : ImageBufferSurface(size, opacityMode) | 
| 45 { | 45 { | 
| 46     m_contextProvider = adoptPtr(blink::Platform::current()->createSharedOffscre
    enGraphicsContext3DProvider()); | 46     m_contextProvider = adoptPtr(Platform::current()->createSharedOffscreenGraph
    icsContext3DProvider()); | 
| 47     if (!m_contextProvider) | 47     if (!m_contextProvider) | 
| 48         return; | 48         return; | 
| 49     GrContext* gr = m_contextProvider->grContext(); | 49     GrContext* gr = m_contextProvider->grContext(); | 
| 50     if (!gr) | 50     if (!gr) | 
| 51         return; | 51         return; | 
| 52     ensureTextureBackedSkBitmap(gr, m_bitmap, size, kDefault_GrSurfaceOrigin, kR
    GBA_8888_GrPixelConfig); | 52     ensureTextureBackedSkBitmap(gr, m_bitmap, size, kDefault_GrSurfaceOrigin, kR
    GBA_8888_GrPixelConfig); | 
| 53 } | 53 } | 
| 54 | 54 | 
| 55 WebGLImageBufferSurface::~WebGLImageBufferSurface() | 55 WebGLImageBufferSurface::~WebGLImageBufferSurface() | 
| 56 { | 56 { | 
| (...skipping 13 matching lines...) Expand all  Loading... | 
| 70 } | 70 } | 
| 71 | 71 | 
| 72 void WebGLImageBufferSurface::updateCachedBitmapIfNeeded() | 72 void WebGLImageBufferSurface::updateCachedBitmapIfNeeded() | 
| 73 { | 73 { | 
| 74     if (m_cachedBitmap.isNull() && m_bitmap.pixelRef()) { | 74     if (m_cachedBitmap.isNull() && m_bitmap.pixelRef()) { | 
| 75         (m_bitmap.pixelRef())->readPixels(&m_cachedBitmap); | 75         (m_bitmap.pixelRef())->readPixels(&m_cachedBitmap); | 
| 76     } | 76     } | 
| 77 } | 77 } | 
| 78 | 78 | 
| 79 } // namespace blink | 79 } // namespace blink | 
| OLD | NEW | 
|---|