MediaPlayerPrivateAVFoundation::MediaRenderingMode MediaPlayerPrivateAVFoundation::currentRenderingMode() const { #if USE(ACCELERATED_COMPOSITING) if (platformLayer()) return MediaRenderingToLayer; #endif if (hasContextRenderer()) return MediaRenderingToContext; return MediaRenderingNone; }
bool GraphicsLayerChromium::addAnimation(const KeyframeValueList& values, const IntSize& boxSize, const Animation* animation, const String& animationName, double timeOffset) { platformLayer()->setAnimationDelegate(this); int animationId = 0; if (m_animationIdMap.contains(animationName)) animationId = m_animationIdMap.get(animationName); OwnPtr<WebAnimation> toAdd(createWebAnimation(values, animation, animationId, timeOffset, boxSize)); if (toAdd) { animationId = toAdd->id(); m_animationIdMap.set(animationName, animationId); // Remove any existing animations with the same animation id and target property. platformLayer()->removeAnimation(animationId, toAdd->targetProperty()); return platformLayer()->addAnimation(toAdd.get()); } return false; }
void GraphicsLayer::setReplicatedByLayer(GraphicsLayer* layer) { // FIXME: this could probably be a full early exit. if (m_replicaLayer != layer) { if (m_replicaLayer) m_replicaLayer->setReplicatedLayer(0); if (layer) layer->setReplicatedLayer(this); m_replicaLayer = layer; } WebLayer* webReplicaLayer = layer ? layer->platformLayer() : 0; platformLayer()->setReplicaLayer(webReplicaLayer); }
bool ImageBuffer::copyToPlatformTexture(WebGraphicsContext3D* context, Platform3DObject texture, GLenum internalFormat, GLenum destType, GLint level, bool premultiplyAlpha, bool flipY) { if (!m_surface->isAccelerated() || !platformLayer() || !isSurfaceValid()) return false; if (!Extensions3DUtil::canUseCopyTextureCHROMIUM(internalFormat, destType, level)) return false; OwnPtr<WebGraphicsContext3DProvider> provider = adoptPtr(Platform::current()->createSharedOffscreenGraphicsContext3DProvider()); if (!provider) return false; WebGraphicsContext3D* sharedContext = provider->context3d(); if (!sharedContext) return false; OwnPtr<WebExternalTextureMailbox> mailbox = adoptPtr(new WebExternalTextureMailbox); // Contexts may be in a different share group. We must transfer the texture through a mailbox first sharedContext->genMailboxCHROMIUM(mailbox->name); sharedContext->produceTextureDirectCHROMIUM(getBackingTexture(), GL_TEXTURE_2D, mailbox->name); sharedContext->flush(); mailbox->syncPoint = sharedContext->insertSyncPoint(); context->waitSyncPoint(mailbox->syncPoint); Platform3DObject sourceTexture = context->createAndConsumeTextureCHROMIUM(GL_TEXTURE_2D, mailbox->name); // The canvas is stored in a premultiplied format, so unpremultiply if necessary. context->pixelStorei(GC3D_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, !premultiplyAlpha); // The canvas is stored in an inverted position, so the flip semantics are reversed. context->pixelStorei(GC3D_UNPACK_FLIP_Y_CHROMIUM, !flipY); context->copyTextureCHROMIUM(GL_TEXTURE_2D, sourceTexture, texture, level, internalFormat, destType); context->pixelStorei(GC3D_UNPACK_FLIP_Y_CHROMIUM, false); context->pixelStorei(GC3D_UNPACK_UNPREMULTIPLY_ALPHA_CHROMIUM, false); context->deleteTexture(sourceTexture); context->flush(); sharedContext->waitSyncPoint(context->insertSyncPoint()); // Undo grContext texture binding changes introduced in this function provider->grContext()->resetContext(kTextureBinding_GrGLBackendState); return true; }
void GraphicsLayer::setOpacity(float opacity) { float clampedOpacity = std::max(std::min(opacity, 1.0f), 0.0f); m_opacity = clampedOpacity; platformLayer()->setOpacity(opacity); }
void GraphicsLayer::setTransformOrigin(const FloatPoint3D& transformOrigin) { m_hasTransformOrigin = true; m_transformOrigin = transformOrigin; platformLayer()->setTransformOrigin(transformOrigin); }
void GraphicsLayer::setTransform(const TransformationMatrix& transform) { m_transform = transform; platformLayer()->setTransform(TransformationMatrix::toSkMatrix44(m_transform)); }
void GraphicsLayer::setPosition(const FloatPoint& point) { m_position = point; platformLayer()->setPosition(m_position); }
void GraphicsLayerChromium::removeFromParent() { GraphicsLayer::removeFromParent(); platformLayer()->removeFromParent(); }
void GraphicsLayerChromium::updateAnchorPoint() { platformLayer()->setAnchorPoint(FloatPoint(m_anchorPoint.x(), m_anchorPoint.y())); platformLayer()->setAnchorPointZ(m_anchorPoint.z()); }
void GraphicsLayerChromium::updateLayerPosition() { platformLayer()->setPosition(m_position); }
void GraphicsLayerChromium::resumeAnimations() { platformLayer()->resumeAnimations(monotonicallyIncreasingTime()); }
void GraphicsLayerChromium::removeAnimation(const String& animationName) { if (m_animationIdMap.contains(animationName)) platformLayer()->removeAnimation(m_animationIdMap.get(animationName)); }
void GraphicsLayerChromium::pauseAnimation(const String& animationName, double timeOffset) { if (m_animationIdMap.contains(animationName)) platformLayer()->pauseAnimation(m_animationIdMap.get(animationName), timeOffset); }
void GraphicsLayerChromium::setOpacity(float opacity) { float clampedOpacity = max(min(opacity, 1.0f), 0.0f); GraphicsLayer::setOpacity(clampedOpacity); platformLayer()->setOpacity(opacity); }
void GraphicsLayer::pauseAnimation(int animationId, double timeOffset) { platformLayer()->pauseAnimation(animationId, timeOffset); }
void GraphicsLayer::removeAnimation(int animationId) { platformLayer()->removeAnimation(animationId); }
void GraphicsLayerChromium::updateTransform() { platformLayer()->setTransform(WebTransformationMatrix(m_transform)); }
void GraphicsLayerTextureMapper::commitLayerChanges() { if (m_changeMask == NoChanges) return; if (m_changeMask & ChildrenChange) { Vector<TextureMapperLayer*> textureMapperLayerChildren; toTextureMapperLayerVector(children(), textureMapperLayerChildren); m_layer->setChildren(textureMapperLayerChildren); } if (m_changeMask & MaskLayerChange) m_layer->setMaskLayer(toTextureMapperLayer(maskLayer())); if (m_changeMask & ReplicaLayerChange) m_layer->setReplicaLayer(toTextureMapperLayer(replicaLayer())); if (m_changeMask & PositionChange) m_layer->setPosition(position()); if (m_changeMask & AnchorPointChange) m_layer->setAnchorPoint(anchorPoint()); if (m_changeMask & SizeChange) m_layer->setSize(size()); if (m_changeMask & TransformChange) m_layer->setTransform(transform()); if (m_changeMask & ChildrenTransformChange) m_layer->setChildrenTransform(childrenTransform()); if (m_changeMask & Preserves3DChange) m_layer->setPreserves3D(preserves3D()); if (m_changeMask & ContentsRectChange) m_layer->setContentsRect(contentsRect()); if (m_changeMask & MasksToBoundsChange) m_layer->setMasksToBounds(masksToBounds()); if (m_changeMask & DrawsContentChange) m_layer->setDrawsContent(drawsContent()); if (m_changeMask & ContentsVisibleChange) m_layer->setContentsVisible(contentsAreVisible()); if (m_changeMask & ContentsOpaqueChange) m_layer->setContentsOpaque(contentsOpaque()); if (m_changeMask & BackfaceVisibilityChange) m_layer->setBackfaceVisibility(backfaceVisibility()); if (m_changeMask & OpacityChange) m_layer->setOpacity(opacity()); if (m_changeMask & BackgroundColorChange) m_layer->setSolidColor(solidColor()); #if ENABLE(CSS_FILTERS) if (m_changeMask & FilterChange) m_layer->setFilters(filters()); #endif if (m_changeMask & BackingStoreChange) m_layer->setBackingStore(m_backingStore); if (m_changeMask & DebugVisualsChange) m_layer->setDebugVisuals(isShowingDebugBorder(), debugBorderColor(), debugBorderWidth(), isShowingRepaintCounter()); if (m_changeMask & RepaintCountChange) m_layer->setRepaintCount(repaintCount()); if (m_changeMask & ContentChange) m_layer->setContentsLayer(platformLayer()); if (m_changeMask & AnimationChange) m_layer->setAnimations(m_animations); if (m_changeMask & AnimationStarted) client()->notifyAnimationStarted(this, m_animationStartTime); if (m_changeMask & FixedToViewporChange) m_layer->setFixedToViewport(fixedToViewport()); if (m_changeMask & IsScrollableChange) m_layer->setIsScrollable(isScrollable()); if (m_changeMask & CommittedScrollOffsetChange) m_layer->didCommitScrollOffset(m_committedScrollOffset); m_changeMask = NoChanges; }
void GraphicsLayerChromium::updateChildrenTransform() { platformLayer()->setSublayerTransform(WebTransformationMatrix(m_childrenTransform)); }