PlatformContextSkia* skiaContext(new PlatformContextSkia(platformCanvas.get()));GraphicsContext* graphicsContext(new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(skiaContext.get())));
- [Chromium] chromium/src/third_party/WebKit/Source/WebCore/platform/graphics/chromium/PlatformCanvas.cpp
PlatformCanvas::Painter::Painter(PlatformCanvas* canvas, PlatformCanvas::Painter::TextOption option) { #if USE(SKIA) m_skiaContext = adoptPtr(new PlatformContextSkia(canvas->m_skiaCanvas.get())); m_skiaContext->setDrawingToImageBuffer(option == GrayscaleText); m_context = adoptPtr(new GraphicsContext(reinterpret_cast<PlatformGraphicsContext*>(m_skiaContext.get()))); #elif USE(CG) m_colorSpace = CGColorSpaceCreateDeviceRGB(); size_t rowBytes = canvas->size().width() * 4; m_contextCG = CGBitmapContextCreate(canvas->m_pixelData.get(), canvas->size().width(), canvas->size().height(), 8, rowBytes, m_colorSpace.get(), kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host); CGContextTranslateCTM(m_contextCG.get(), 0, canvas->size().height()); CGContextScaleCTM(m_contextCG.get(), 1, -1); m_context = adoptPtr(new GraphicsContext(m_contextCG.get())); #endif context()->save(); }
'SKIA' 카테고리의 다른 글
| SkCanvas (0) | 2011.09.07 |
|---|---|
| Graphics and Skia (0) | 2011.08.03 |