inline static int getSkBitmapTextureId(const SkBitmap& bitmap, int fallback) { if (!bitmap.getTexture()) return fallback; GrTexture* texture = reinterpret_cast<GrTexture*>(bitmap.getTexture()); return texture->getTextureHandle(); }
Platform3DObject WebGLImageBufferSurface::getBackingTexture() const { GrTexture* texture = m_bitmap.getTexture(); if (!texture) return 0; return texture->getTextureHandle(); }
GrBackendObject SkSurface_Gpu::onGetTextureHandle(BackendHandleAccess access) { GrRenderTarget* rt = prepare_rt_for_external_access(this, access); GrTexture* texture = rt->asTexture(); if (texture) { return texture->getTextureHandle(); } return 0; }
GrBackendObject SkImage::getTextureHandle(bool flushPendingGrContextIO) const { GrTexture* texture = as_IB(this)->getTexture(); if (texture) { GrContext* context = texture->getContext(); if (context) { if (flushPendingGrContextIO) { context->prepareSurfaceForExternalIO(texture); } } return texture->getTextureHandle(); } return 0; }
unsigned Canvas2DLayerBridge::prepareTexture(WebTextureUpdater& updater) { #if ENABLE(CANVAS_USES_MAILBOX) ASSERT_NOT_REACHED(); return 0; #else m_context->makeContextCurrent(); TRACE_EVENT0("cc", "Canvas2DLayerBridge::SkCanvas::flush"); m_canvas->flush(); m_context->flush(); // Notify skia that the state of the backing store texture object will be touched by the compositor GrRenderTarget* renderTarget = reinterpret_cast<GrRenderTarget*>(m_canvas->getDevice()->accessRenderTarget()); if (renderTarget) { GrTexture* texture = renderTarget->asTexture(); texture->invalidateCachedState(); return texture->getTextureHandle(); } return 0; #endif // !ENABLE(CANVAS_USES_MAILBOX) }