summaryrefslogtreecommitdiffstats
path: root/WebCore/platform/graphics/mac
diff options
context:
space:
mode:
authorSteve Block <steveblock@google.com>2010-08-27 11:02:25 +0100
committerSteve Block <steveblock@google.com>2010-09-02 17:17:20 +0100
commite8b154fd68f9b33be40a3590e58347f353835f5c (patch)
tree0733ce26384183245aaa5656af26c653636fe6c1 /WebCore/platform/graphics/mac
parentda56157816334089526a7a115a85fd85a6e9a1dc (diff)
downloadexternal_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.zip
external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.gz
external_webkit-e8b154fd68f9b33be40a3590e58347f353835f5c.tar.bz2
Merge WebKit at r66079 : Initial merge by git
Change-Id: Ie2e1440fb9d487d24e52c247342c076fecaecac7
Diffstat (limited to 'WebCore/platform/graphics/mac')
-rw-r--r--WebCore/platform/graphics/mac/FontCustomPlatformData.cpp2
-rw-r--r--WebCore/platform/graphics/mac/FontPlatformDataMac.mm18
-rw-r--r--WebCore/platform/graphics/mac/GraphicsContext3DMac.mm42
-rw-r--r--WebCore/platform/graphics/mac/GraphicsLayerCA.mm15
4 files changed, 41 insertions, 36 deletions
diff --git a/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp b/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
index c591ddc..a600d73 100644
--- a/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
+++ b/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp
@@ -31,8 +31,10 @@ namespace WebCore {
FontCustomPlatformData::~FontCustomPlatformData()
{
+#if defined(BUILDING_ON_TIGER) || defined(BUILDING_ON_LEOPARD)
if (m_atsContainer)
ATSFontDeactivate(m_atsContainer, NULL, kATSOptionFlagsDefault);
+#endif
CGFontRelease(m_cgFont);
}
diff --git a/WebCore/platform/graphics/mac/FontPlatformDataMac.mm b/WebCore/platform/graphics/mac/FontPlatformDataMac.mm
index 33de3c3..d905b62 100644
--- a/WebCore/platform/graphics/mac/FontPlatformDataMac.mm
+++ b/WebCore/platform/graphics/mac/FontPlatformDataMac.mm
@@ -39,9 +39,10 @@ FontPlatformData::FontPlatformData(NSFont *nsFont, bool syntheticBold, bool synt
, m_isColorBitmapFont(false)
#endif
{
- if (nsFont)
- CFRetain(nsFont);
- m_size = nsFont ? [nsFont pointSize] : 0.0f;
+ ASSERT_ARG(nsFont, nsFont);
+
+ CFRetain(nsFont);
+ m_size = [nsFont pointSize];
#ifndef BUILDING_ON_TIGER
m_cgFont.adoptCF(CTFontCopyGraphicsFont(toCTFontRef(nsFont), 0));
m_atsuFontID = CTFontGetPlatformFont(toCTFontRef(nsFont), 0);
@@ -95,14 +96,17 @@ const FontPlatformData& FontPlatformData::operator=(const FontPlatformData& f)
void FontPlatformData::setFont(NSFont *font)
{
+ ASSERT_ARG(font, font);
+ ASSERT(m_font != reinterpret_cast<NSFont *>(-1));
+
if (m_font == font)
return;
- if (font)
- CFRetain(font);
- if (m_font && m_font != reinterpret_cast<NSFont *>(-1))
+
+ CFRetain(font);
+ if (m_font)
CFRelease(m_font);
m_font = font;
- m_size = font ? [font pointSize] : 0.0f;
+ m_size = [font pointSize];
#ifndef BUILDING_ON_TIGER
m_cgFont.adoptCF(CTFontCopyGraphicsFont(toCTFontRef(font), 0));
m_atsuFontID = CTFontGetPlatformFont(toCTFontRef(font), 0);
diff --git a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
index be1d278..ab4ef4b 100644
--- a/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
+++ b/WebCore/platform/graphics/mac/GraphicsContext3DMac.mm
@@ -312,6 +312,16 @@ bool GraphicsContext3D::isGLES2Compliant() const
return false;
}
+bool GraphicsContext3D::isGLES2NPOTStrict() const
+{
+ return false;
+}
+
+bool GraphicsContext3D::isErrorGeneratedOnOutOfBoundsAccesses() const
+{
+ return false;
+}
+
void GraphicsContext3D::reshape(int width, int height)
{
if (width == m_currentWidth && height == m_currentHeight || !m_contextObj)
@@ -557,40 +567,16 @@ void GraphicsContext3D::bufferData(unsigned long target, int size, unsigned long
::glBufferData(target, size, 0, usage);
}
-void GraphicsContext3D::bufferData(unsigned long target, ArrayBuffer* array, unsigned long usage)
-{
- if (!array || !array->byteLength())
- return;
-
- ensureContext(m_contextObj);
- ::glBufferData(target, array->byteLength(), array->data(), usage);
-}
-
-void GraphicsContext3D::bufferData(unsigned long target, ArrayBufferView* array, unsigned long usage)
-{
- if (!array || !array->length())
- return;
-
- ensureContext(m_contextObj);
- ::glBufferData(target, array->byteLength(), array->baseAddress(), usage);
-}
-
-void GraphicsContext3D::bufferSubData(unsigned long target, long offset, ArrayBuffer* array)
+void GraphicsContext3D::bufferData(unsigned long target, int size, const void* data, unsigned long usage)
{
- if (!array || !array->byteLength())
- return;
-
ensureContext(m_contextObj);
- ::glBufferSubData(target, offset, array->byteLength(), array->data());
+ ::glBufferData(target, size, data, usage);
}
-void GraphicsContext3D::bufferSubData(unsigned long target, long offset, ArrayBufferView* array)
+void GraphicsContext3D::bufferSubData(unsigned long target, long offset, int size, const void* data)
{
- if (!array || !array->length())
- return;
-
ensureContext(m_contextObj);
- ::glBufferSubData(target, offset, array->byteLength(), array->baseAddress());
+ ::glBufferSubData(target, offset, size, data);
}
unsigned long GraphicsContext3D::checkFramebufferStatus(unsigned long target)
diff --git a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
index cb4ca58..315cc00 100644
--- a/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
+++ b/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
@@ -1213,6 +1213,18 @@ void GraphicsLayerCA::updateContentsOpaque()
void GraphicsLayerCA::updateBackfaceVisibility()
{
+ if (m_structuralLayer && structuralLayerPurpose() == StructuralLayerForReplicaFlattening) {
+ [m_structuralLayer.get() setDoubleSided:m_backfaceVisibility];
+
+ if (LayerMap* layerCloneMap = m_structuralLayerClones.get()) {
+ LayerMap::const_iterator end = layerCloneMap->end();
+ for (LayerMap::const_iterator it = layerCloneMap->begin(); it != end; ++it) {
+ CALayer *currLayer = it->second.get();
+ [currLayer setDoubleSided:m_backfaceVisibility];
+ }
+ }
+ }
+
[m_layer.get() setDoubleSided:m_backfaceVisibility];
if (LayerMap* layerCloneMap = m_layerClones.get()) {
@@ -1243,7 +1255,7 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose)
// Release the structural layer.
m_structuralLayer = 0;
- // Update the properties of m_layer now that we no loner have a structural layer.
+ // Update the properties of m_layer now that we no longer have a structural layer.
updateLayerPosition();
updateLayerSize();
updateAnchorPoint();
@@ -1294,6 +1306,7 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose)
updateAnchorPoint();
updateTransform();
updateChildrenTransform();
+ updateBackfaceVisibility();
// Set properties of m_layer to their default values, since these are expressed on on the structural layer.
CGPoint point = CGPointMake(m_size.width() / 2.0f, m_size.height() / 2.0f);