| 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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 m_contextProvider = adoptPtr(Platform::current()->createSharedOffscreenGraph
icsContext3DProvider()); | 48 m_contextProvider = adoptPtr(Platform::current()->createSharedOffscreenGraph
icsContext3DProvider()); |
| 49 if (!m_contextProvider) | 49 if (!m_contextProvider) |
| 50 return; | 50 return; |
| 51 GrContext* grContext = m_contextProvider->grContext(); | 51 GrContext* grContext = m_contextProvider->grContext(); |
| 52 if (!grContext) | 52 if (!grContext) |
| 53 return; | 53 return; |
| 54 | 54 |
| 55 SkAlphaType alphaType = (Opaque == opacityMode) ? kOpaque_SkAlphaType : kPre
mul_SkAlphaType; | 55 SkAlphaType alphaType = (Opaque == opacityMode) ? kOpaque_SkAlphaType : kPre
mul_SkAlphaType; |
| 56 SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), alphaTy
pe); | 56 SkImageInfo info = SkImageInfo::MakeN32(size.width(), size.height(), alphaTy
pe); |
| 57 SkSurfaceProps disableLCDProps(0, kUnknown_SkPixelGeometry); | 57 SkSurfaceProps disableLCDProps(0, kUnknown_SkPixelGeometry); |
| 58 m_surface = adoptPtr(SkSurface::NewScratchRenderTarget(grContext, info, msaa
SampleCount, | 58 m_surface = adoptPtr(SkSurface::NewRenderTarget(grContext, SkSurface::kYes_B
udgeted, info, msaaSampleCount, |
| 59 Opaque == opacityMode ? 0 : &disableLCDProps)); | 59 Opaque == opacityMode ? 0 : &disableLCDProps)); |
| 60 if (!m_surface.get()) | 60 if (!m_surface.get()) |
| 61 return; | 61 return; |
| 62 clear(); | 62 clear(); |
| 63 } | 63 } |
| 64 | 64 |
| 65 Platform3DObject AcceleratedImageBufferSurface::getBackingTexture() const | 65 Platform3DObject AcceleratedImageBufferSurface::getBackingTexture() const |
| 66 { | 66 { |
| 67 GrRenderTarget* renderTarget = m_surface->getCanvas()->getTopDevice()->acces
sRenderTarget(); | 67 GrRenderTarget* renderTarget = m_surface->getCanvas()->getTopDevice()->acces
sRenderTarget(); |
| 68 if (renderTarget) { | 68 if (renderTarget) { |
| 69 return renderTarget->asTexture()->getTextureHandle(); | 69 return renderTarget->asTexture()->getTextureHandle(); |
| 70 } | 70 } |
| 71 return 0; | 71 return 0; |
| 72 } | 72 } |
| 73 | 73 |
| 74 } // namespace blink | 74 } // namespace blink |
| OLD | NEW |