|
|
|
@@ -40551,6 +40551,11 @@ void Component::setBounds (const RelativeRectangle& newBounds) |
|
|
|
newBounds.applyToComponent (*this); |
|
|
|
} |
|
|
|
|
|
|
|
void Component::setBounds (const String& newBoundsExpression) |
|
|
|
{ |
|
|
|
setBounds (RelativeRectangle (newBoundsExpression)); |
|
|
|
} |
|
|
|
|
|
|
|
void Component::setBoundsRelative (const float x, const float y, |
|
|
|
const float w, const float h) |
|
|
|
{ |
|
|
|
@@ -63015,10 +63020,10 @@ void ResizableEdgeComponent::mouseDrag (const MouseEvent& e) |
|
|
|
|
|
|
|
switch (edge) |
|
|
|
{ |
|
|
|
case leftEdge: bounds.setLeft (bounds.getX() + e.getDistanceFromDragStartX()); break; |
|
|
|
case rightEdge: bounds.setWidth (bounds.getWidth() + e.getDistanceFromDragStartX()); break; |
|
|
|
case topEdge: bounds.setTop (bounds.getY() + e.getDistanceFromDragStartY()); break; |
|
|
|
case bottomEdge: bounds.setHeight (bounds.getHeight() + e.getDistanceFromDragStartY()); break; |
|
|
|
case leftEdge: bounds.setLeft (jmin (bounds.getRight(), bounds.getX() + e.getDistanceFromDragStartX())); break; |
|
|
|
case rightEdge: bounds.setWidth (jmax (0, bounds.getWidth() + e.getDistanceFromDragStartX())); break; |
|
|
|
case topEdge: bounds.setTop (jmin (bounds.getBottom(), bounds.getY() + e.getDistanceFromDragStartY())); break; |
|
|
|
case bottomEdge: bounds.setHeight (jmax (0, bounds.getHeight() + e.getDistanceFromDragStartY())); break; |
|
|
|
default: jassertfalse; break; |
|
|
|
} |
|
|
|
|
|
|
|
@@ -261088,6 +261093,7 @@ public: |
|
|
|
|
|
|
|
~ALSAAudioIODevice() |
|
|
|
{ |
|
|
|
close(); |
|
|
|
} |
|
|
|
|
|
|
|
const StringArray getOutputChannelNames() { return internal.channelNamesOut; } |
|
|
|
@@ -268247,36 +268253,28 @@ public: |
|
|
|
: renderContext (0), |
|
|
|
pixelFormat (pixelFormat_) |
|
|
|
{ |
|
|
|
NSOpenGLPixelFormatAttribute attribs [64]; |
|
|
|
int n = 0; |
|
|
|
attribs[n++] = NSOpenGLPFADoubleBuffer; |
|
|
|
attribs[n++] = NSOpenGLPFAAccelerated; |
|
|
|
attribs[n++] = NSOpenGLPFAMPSafe; // NSOpenGLPFAAccelerated, NSOpenGLPFAMultiScreen, NSOpenGLPFASingleRenderer |
|
|
|
attribs[n++] = NSOpenGLPFAColorSize; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) jmax (pixelFormat.redBits, |
|
|
|
pixelFormat.greenBits, |
|
|
|
pixelFormat.blueBits); |
|
|
|
attribs[n++] = NSOpenGLPFAAlphaSize; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) pixelFormat.alphaBits; |
|
|
|
attribs[n++] = NSOpenGLPFADepthSize; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) pixelFormat.depthBufferBits; |
|
|
|
attribs[n++] = NSOpenGLPFAStencilSize; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) pixelFormat.stencilBufferBits; |
|
|
|
attribs[n++] = NSOpenGLPFAAccumSize; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) jmax (pixelFormat.accumulationBufferRedBits, |
|
|
|
pixelFormat.accumulationBufferGreenBits, |
|
|
|
pixelFormat.accumulationBufferBlueBits, |
|
|
|
pixelFormat.accumulationBufferAlphaBits); |
|
|
|
|
|
|
|
// xxx not sure how to do fullSceneAntiAliasingNumSamples.. |
|
|
|
attribs[n++] = NSOpenGLPFASampleBuffers; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) 1; |
|
|
|
attribs[n++] = NSOpenGLPFAClosestPolicy; |
|
|
|
attribs[n++] = NSOpenGLPFANoRecovery; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) 0; |
|
|
|
|
|
|
|
NSOpenGLPixelFormat* format |
|
|
|
= [[NSOpenGLPixelFormat alloc] initWithAttributes: attribs]; |
|
|
|
NSOpenGLPixelFormatAttribute attribs[] = |
|
|
|
{ |
|
|
|
NSOpenGLPFADoubleBuffer, |
|
|
|
NSOpenGLPFAAccelerated, |
|
|
|
NSOpenGLPFAMPSafe, |
|
|
|
NSOpenGLPFAClosestPolicy, |
|
|
|
NSOpenGLPFANoRecovery, |
|
|
|
NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute) (pixelFormat.redBits |
|
|
|
+ pixelFormat.greenBits |
|
|
|
+ pixelFormat.blueBits), |
|
|
|
NSOpenGLPFAAlphaSize, (NSOpenGLPixelFormatAttribute) pixelFormat.alphaBits, |
|
|
|
NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute) pixelFormat.depthBufferBits, |
|
|
|
NSOpenGLPFAStencilSize, (NSOpenGLPixelFormatAttribute) pixelFormat.stencilBufferBits, |
|
|
|
NSOpenGLPFAAccumSize, (NSOpenGLPixelFormatAttribute) (pixelFormat.accumulationBufferRedBits |
|
|
|
+ pixelFormat.accumulationBufferGreenBits |
|
|
|
+ pixelFormat.accumulationBufferBlueBits |
|
|
|
+ pixelFormat.accumulationBufferAlphaBits), |
|
|
|
NSOpenGLPFASampleBuffers, (NSOpenGLPixelFormatAttribute) 1, |
|
|
|
0 |
|
|
|
}; |
|
|
|
|
|
|
|
NSOpenGLPixelFormat* format = [[NSOpenGLPixelFormat alloc] initWithAttributes: attribs]; |
|
|
|
|
|
|
|
view = [[ThreadSafeNSOpenGLView alloc] initWithFrame: NSMakeRect (0, 0, 100.0f, 100.0f) |
|
|
|
pixelFormat: format]; |
|
|
|
@@ -268402,39 +268400,46 @@ void juce_glViewport (const int w, const int h) |
|
|
|
glViewport (0, 0, w, h); |
|
|
|
} |
|
|
|
|
|
|
|
static int getPixelFormatAttribute (NSOpenGLPixelFormat* p, NSOpenGLPixelFormatAttribute att) |
|
|
|
{ |
|
|
|
GLint val = 0; |
|
|
|
[p getValues: &val forAttribute: att forVirtualScreen: 0]; |
|
|
|
return (int) val; |
|
|
|
} |
|
|
|
|
|
|
|
void OpenGLPixelFormat::getAvailablePixelFormats (Component* /*component*/, |
|
|
|
OwnedArray <OpenGLPixelFormat>& /*results*/) |
|
|
|
OwnedArray <OpenGLPixelFormat>& results) |
|
|
|
{ |
|
|
|
/* GLint attribs [64]; |
|
|
|
int n = 0; |
|
|
|
attribs[n++] = AGL_RGBA; |
|
|
|
attribs[n++] = AGL_DOUBLEBUFFER; |
|
|
|
attribs[n++] = AGL_ACCELERATED; |
|
|
|
attribs[n++] = AGL_NO_RECOVERY; |
|
|
|
attribs[n++] = AGL_NONE; |
|
|
|
NSOpenGLPixelFormatAttribute attributes[] = |
|
|
|
{ |
|
|
|
NSOpenGLPFAWindow, |
|
|
|
NSOpenGLPFADoubleBuffer, |
|
|
|
NSOpenGLPFAAccelerated, |
|
|
|
NSOpenGLPFANoRecovery, |
|
|
|
NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute) 16, |
|
|
|
NSOpenGLPFAAlphaSize, (NSOpenGLPixelFormatAttribute) 8, |
|
|
|
NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute) 24, |
|
|
|
NSOpenGLPFAAccumSize, (NSOpenGLPixelFormatAttribute) 32, |
|
|
|
0 |
|
|
|
}; |
|
|
|
|
|
|
|
AGLPixelFormat p = aglChoosePixelFormat (0, 0, attribs); |
|
|
|
NSOpenGLPixelFormat* format = [[NSOpenGLPixelFormat alloc] initWithAttributes: attributes]; |
|
|
|
|
|
|
|
while (p != 0) |
|
|
|
if (format != nil) |
|
|
|
{ |
|
|
|
OpenGLPixelFormat* const pf = new OpenGLPixelFormat(); |
|
|
|
pf->redBits = getAGLAttribute (p, AGL_RED_SIZE); |
|
|
|
pf->greenBits = getAGLAttribute (p, AGL_GREEN_SIZE); |
|
|
|
pf->blueBits = getAGLAttribute (p, AGL_BLUE_SIZE); |
|
|
|
pf->alphaBits = getAGLAttribute (p, AGL_ALPHA_SIZE); |
|
|
|
pf->depthBufferBits = getAGLAttribute (p, AGL_DEPTH_SIZE); |
|
|
|
pf->stencilBufferBits = getAGLAttribute (p, AGL_STENCIL_SIZE); |
|
|
|
pf->accumulationBufferRedBits = getAGLAttribute (p, AGL_ACCUM_RED_SIZE); |
|
|
|
pf->accumulationBufferGreenBits = getAGLAttribute (p, AGL_ACCUM_GREEN_SIZE); |
|
|
|
pf->accumulationBufferBlueBits = getAGLAttribute (p, AGL_ACCUM_BLUE_SIZE); |
|
|
|
pf->accumulationBufferAlphaBits = getAGLAttribute (p, AGL_ACCUM_ALPHA_SIZE); |
|
|
|
|
|
|
|
results.add (pf); |
|
|
|
|
|
|
|
p = aglNextPixelFormat (p); |
|
|
|
}*/ |
|
|
|
pf->redBits = pf->greenBits = pf->blueBits = getPixelFormatAttribute (format, NSOpenGLPFAColorSize) / 3; |
|
|
|
pf->alphaBits = getPixelFormatAttribute (format, NSOpenGLPFAAlphaSize); |
|
|
|
pf->depthBufferBits = getPixelFormatAttribute (format, NSOpenGLPFADepthSize); |
|
|
|
pf->stencilBufferBits = getPixelFormatAttribute (format, NSOpenGLPFAStencilSize); |
|
|
|
pf->accumulationBufferRedBits = pf->accumulationBufferGreenBits |
|
|
|
= pf->accumulationBufferBlueBits = pf->accumulationBufferAlphaBits |
|
|
|
= getPixelFormatAttribute (format, NSOpenGLPFAAccumSize) / 4; |
|
|
|
|
|
|
|
//jassertfalse // can't see how you do this in cocoa! |
|
|
|
[format release]; |
|
|
|
results.add (pf); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#else |
|
|
|
@@ -273950,36 +273955,28 @@ public: |
|
|
|
: renderContext (0), |
|
|
|
pixelFormat (pixelFormat_) |
|
|
|
{ |
|
|
|
NSOpenGLPixelFormatAttribute attribs [64]; |
|
|
|
int n = 0; |
|
|
|
attribs[n++] = NSOpenGLPFADoubleBuffer; |
|
|
|
attribs[n++] = NSOpenGLPFAAccelerated; |
|
|
|
attribs[n++] = NSOpenGLPFAMPSafe; // NSOpenGLPFAAccelerated, NSOpenGLPFAMultiScreen, NSOpenGLPFASingleRenderer |
|
|
|
attribs[n++] = NSOpenGLPFAColorSize; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) jmax (pixelFormat.redBits, |
|
|
|
pixelFormat.greenBits, |
|
|
|
pixelFormat.blueBits); |
|
|
|
attribs[n++] = NSOpenGLPFAAlphaSize; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) pixelFormat.alphaBits; |
|
|
|
attribs[n++] = NSOpenGLPFADepthSize; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) pixelFormat.depthBufferBits; |
|
|
|
attribs[n++] = NSOpenGLPFAStencilSize; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) pixelFormat.stencilBufferBits; |
|
|
|
attribs[n++] = NSOpenGLPFAAccumSize; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) jmax (pixelFormat.accumulationBufferRedBits, |
|
|
|
pixelFormat.accumulationBufferGreenBits, |
|
|
|
pixelFormat.accumulationBufferBlueBits, |
|
|
|
pixelFormat.accumulationBufferAlphaBits); |
|
|
|
|
|
|
|
// xxx not sure how to do fullSceneAntiAliasingNumSamples.. |
|
|
|
attribs[n++] = NSOpenGLPFASampleBuffers; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) 1; |
|
|
|
attribs[n++] = NSOpenGLPFAClosestPolicy; |
|
|
|
attribs[n++] = NSOpenGLPFANoRecovery; |
|
|
|
attribs[n++] = (NSOpenGLPixelFormatAttribute) 0; |
|
|
|
|
|
|
|
NSOpenGLPixelFormat* format |
|
|
|
= [[NSOpenGLPixelFormat alloc] initWithAttributes: attribs]; |
|
|
|
NSOpenGLPixelFormatAttribute attribs[] = |
|
|
|
{ |
|
|
|
NSOpenGLPFADoubleBuffer, |
|
|
|
NSOpenGLPFAAccelerated, |
|
|
|
NSOpenGLPFAMPSafe, |
|
|
|
NSOpenGLPFAClosestPolicy, |
|
|
|
NSOpenGLPFANoRecovery, |
|
|
|
NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute) (pixelFormat.redBits |
|
|
|
+ pixelFormat.greenBits |
|
|
|
+ pixelFormat.blueBits), |
|
|
|
NSOpenGLPFAAlphaSize, (NSOpenGLPixelFormatAttribute) pixelFormat.alphaBits, |
|
|
|
NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute) pixelFormat.depthBufferBits, |
|
|
|
NSOpenGLPFAStencilSize, (NSOpenGLPixelFormatAttribute) pixelFormat.stencilBufferBits, |
|
|
|
NSOpenGLPFAAccumSize, (NSOpenGLPixelFormatAttribute) (pixelFormat.accumulationBufferRedBits |
|
|
|
+ pixelFormat.accumulationBufferGreenBits |
|
|
|
+ pixelFormat.accumulationBufferBlueBits |
|
|
|
+ pixelFormat.accumulationBufferAlphaBits), |
|
|
|
NSOpenGLPFASampleBuffers, (NSOpenGLPixelFormatAttribute) 1, |
|
|
|
0 |
|
|
|
}; |
|
|
|
|
|
|
|
NSOpenGLPixelFormat* format = [[NSOpenGLPixelFormat alloc] initWithAttributes: attribs]; |
|
|
|
|
|
|
|
view = [[ThreadSafeNSOpenGLView alloc] initWithFrame: NSMakeRect (0, 0, 100.0f, 100.0f) |
|
|
|
pixelFormat: format]; |
|
|
|
@@ -274105,39 +274102,46 @@ void juce_glViewport (const int w, const int h) |
|
|
|
glViewport (0, 0, w, h); |
|
|
|
} |
|
|
|
|
|
|
|
static int getPixelFormatAttribute (NSOpenGLPixelFormat* p, NSOpenGLPixelFormatAttribute att) |
|
|
|
{ |
|
|
|
GLint val = 0; |
|
|
|
[p getValues: &val forAttribute: att forVirtualScreen: 0]; |
|
|
|
return (int) val; |
|
|
|
} |
|
|
|
|
|
|
|
void OpenGLPixelFormat::getAvailablePixelFormats (Component* /*component*/, |
|
|
|
OwnedArray <OpenGLPixelFormat>& /*results*/) |
|
|
|
OwnedArray <OpenGLPixelFormat>& results) |
|
|
|
{ |
|
|
|
/* GLint attribs [64]; |
|
|
|
int n = 0; |
|
|
|
attribs[n++] = AGL_RGBA; |
|
|
|
attribs[n++] = AGL_DOUBLEBUFFER; |
|
|
|
attribs[n++] = AGL_ACCELERATED; |
|
|
|
attribs[n++] = AGL_NO_RECOVERY; |
|
|
|
attribs[n++] = AGL_NONE; |
|
|
|
NSOpenGLPixelFormatAttribute attributes[] = |
|
|
|
{ |
|
|
|
NSOpenGLPFAWindow, |
|
|
|
NSOpenGLPFADoubleBuffer, |
|
|
|
NSOpenGLPFAAccelerated, |
|
|
|
NSOpenGLPFANoRecovery, |
|
|
|
NSOpenGLPFADepthSize, (NSOpenGLPixelFormatAttribute) 16, |
|
|
|
NSOpenGLPFAAlphaSize, (NSOpenGLPixelFormatAttribute) 8, |
|
|
|
NSOpenGLPFAColorSize, (NSOpenGLPixelFormatAttribute) 24, |
|
|
|
NSOpenGLPFAAccumSize, (NSOpenGLPixelFormatAttribute) 32, |
|
|
|
0 |
|
|
|
}; |
|
|
|
|
|
|
|
AGLPixelFormat p = aglChoosePixelFormat (0, 0, attribs); |
|
|
|
NSOpenGLPixelFormat* format = [[NSOpenGLPixelFormat alloc] initWithAttributes: attributes]; |
|
|
|
|
|
|
|
while (p != 0) |
|
|
|
if (format != nil) |
|
|
|
{ |
|
|
|
OpenGLPixelFormat* const pf = new OpenGLPixelFormat(); |
|
|
|
pf->redBits = getAGLAttribute (p, AGL_RED_SIZE); |
|
|
|
pf->greenBits = getAGLAttribute (p, AGL_GREEN_SIZE); |
|
|
|
pf->blueBits = getAGLAttribute (p, AGL_BLUE_SIZE); |
|
|
|
pf->alphaBits = getAGLAttribute (p, AGL_ALPHA_SIZE); |
|
|
|
pf->depthBufferBits = getAGLAttribute (p, AGL_DEPTH_SIZE); |
|
|
|
pf->stencilBufferBits = getAGLAttribute (p, AGL_STENCIL_SIZE); |
|
|
|
pf->accumulationBufferRedBits = getAGLAttribute (p, AGL_ACCUM_RED_SIZE); |
|
|
|
pf->accumulationBufferGreenBits = getAGLAttribute (p, AGL_ACCUM_GREEN_SIZE); |
|
|
|
pf->accumulationBufferBlueBits = getAGLAttribute (p, AGL_ACCUM_BLUE_SIZE); |
|
|
|
pf->accumulationBufferAlphaBits = getAGLAttribute (p, AGL_ACCUM_ALPHA_SIZE); |
|
|
|
|
|
|
|
results.add (pf); |
|
|
|
|
|
|
|
p = aglNextPixelFormat (p); |
|
|
|
}*/ |
|
|
|
pf->redBits = pf->greenBits = pf->blueBits = getPixelFormatAttribute (format, NSOpenGLPFAColorSize) / 3; |
|
|
|
pf->alphaBits = getPixelFormatAttribute (format, NSOpenGLPFAAlphaSize); |
|
|
|
pf->depthBufferBits = getPixelFormatAttribute (format, NSOpenGLPFADepthSize); |
|
|
|
pf->stencilBufferBits = getPixelFormatAttribute (format, NSOpenGLPFAStencilSize); |
|
|
|
pf->accumulationBufferRedBits = pf->accumulationBufferGreenBits |
|
|
|
= pf->accumulationBufferBlueBits = pf->accumulationBufferAlphaBits |
|
|
|
= getPixelFormatAttribute (format, NSOpenGLPFAAccumSize) / 4; |
|
|
|
|
|
|
|
//jassertfalse // can't see how you do this in cocoa! |
|
|
|
[format release]; |
|
|
|
results.add (pf); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
#else |
|
|
|
@@ -277812,6 +277816,8 @@ public: |
|
|
|
|
|
|
|
~CoreAudioIODevice() |
|
|
|
{ |
|
|
|
close(); |
|
|
|
|
|
|
|
AudioObjectPropertyAddress pa; |
|
|
|
pa.mSelector = kAudioObjectPropertySelectorWildcard; |
|
|
|
pa.mScope = kAudioObjectPropertyScopeWildcard; |
|
|
|
@@ -279270,6 +279276,7 @@ BEGIN_JUCE_NAMESPACE |
|
|
|
METHOD (paintClass, descent, "descent", "()F") \ |
|
|
|
METHOD (paintClass, setTextSize, "setTextSize", "(F)V") \ |
|
|
|
METHOD (paintClass, getTextWidths, "getTextWidths", "(Ljava/lang/String;[F)I") \ |
|
|
|
METHOD (paintClass, setTextScaleX, "setTextScaleX", "(F)V") \ |
|
|
|
\ |
|
|
|
METHOD (shaderClass, setLocalMatrix, "setLocalMatrix", "(Landroid/graphics/Matrix;)V") \ |
|
|
|
STATICFIELD (shaderTileModeClass, clampMode, "CLAMP", "Landroid/graphics/Shader$TileMode;") \ |
|
|
|
@@ -279292,6 +279299,7 @@ BEGIN_JUCE_NAMESPACE |
|
|
|
METHOD (matrixClass, setValues, "setValues", "([F)V") \ |
|
|
|
\ |
|
|
|
STATICMETHOD (typefaceClass, create, "create", "(Ljava/lang/String;I)Landroid/graphics/Typeface;") \ |
|
|
|
STATICMETHOD (typefaceClass, createFromFile, "createFromFile", "(Ljava/lang/String;)Landroid/graphics/Typeface;") \ |
|
|
|
\ |
|
|
|
METHOD (rectClass, rectConstructor, "<init>", "(IIII)V") \ |
|
|
|
FIELD (rectClass, rectLeft, "left", "I") \ |
|
|
|
@@ -279606,12 +279614,15 @@ public: |
|
|
|
String appFile, appDataDir; |
|
|
|
int screenWidth, screenHeight; |
|
|
|
|
|
|
|
jobject createPaint() |
|
|
|
jobject createPaint (Graphics::ResamplingQuality quality) |
|
|
|
{ |
|
|
|
const jint constructorFlags = 1 /*ANTI_ALIAS_FLAG*/ |
|
|
|
| 2 /*FILTER_BITMAP_FLAG*/ |
|
|
|
| 4 /*DITHER_FLAG*/ |
|
|
|
| 128 /*SUBPIXEL_TEXT_FLAG*/; |
|
|
|
jint constructorFlags = 1 /*ANTI_ALIAS_FLAG*/ |
|
|
|
| 4 /*DITHER_FLAG*/ |
|
|
|
| 128 /*SUBPIXEL_TEXT_FLAG*/; |
|
|
|
|
|
|
|
if (quality > Graphics::lowResamplingQuality) |
|
|
|
constructorFlags |= 2; /*FILTER_BITMAP_FLAG*/ |
|
|
|
|
|
|
|
return getEnv()->NewObject (paintClass, paintClassConstructor, constructorFlags); |
|
|
|
} |
|
|
|
|
|
|
|
@@ -281306,10 +281317,16 @@ public: |
|
|
|
if (font.isBold()) flags = 1; |
|
|
|
if (font.isItalic()) flags += 2; |
|
|
|
|
|
|
|
typeface = GlobalRef (getEnv()->CallStaticObjectMethod (android.typefaceClass, android.create, |
|
|
|
javaString (getName()).get(), flags)); |
|
|
|
File fontFile (File ("/system/fonts").getChildFile (name).withFileExtension (".ttf")); |
|
|
|
|
|
|
|
if (fontFile.exists()) |
|
|
|
typeface = GlobalRef (getEnv()->CallStaticObjectMethod (android.typefaceClass, android.createFromFile, |
|
|
|
javaString (fontFile.getFullPathName()).get())); |
|
|
|
else |
|
|
|
typeface = GlobalRef (getEnv()->CallStaticObjectMethod (android.typefaceClass, android.create, |
|
|
|
javaString (getName()).get(), flags)); |
|
|
|
|
|
|
|
paint = GlobalRef (android.createPaint()); |
|
|
|
paint = GlobalRef (android.createPaint (Graphics::highResamplingQuality)); |
|
|
|
const LocalRef<jobject> ignored (paint.callObjectMethod (android.setTypeface, typeface.get())); |
|
|
|
|
|
|
|
const float standardSize = 256.0f; |
|
|
|
@@ -281619,7 +281636,7 @@ public: |
|
|
|
|
|
|
|
void setInterpolationQuality (Graphics::ResamplingQuality quality) |
|
|
|
{ |
|
|
|
// TODO xxx |
|
|
|
currentState->setInterpolationQuality (quality); |
|
|
|
} |
|
|
|
|
|
|
|
void fillRect (const Rectangle<int>& r, bool replaceExistingContents) |
|
|
|
@@ -281766,24 +281783,36 @@ public: |
|
|
|
|
|
|
|
void beginTransparencyLayer (float opacity) |
|
|
|
{ |
|
|
|
// TODO xxx |
|
|
|
Rectangle<int> clip (getClipBounds()); |
|
|
|
|
|
|
|
(void) canvas.callIntMethod (android.saveLayerAlpha, |
|
|
|
(float) clip.getX(), |
|
|
|
(float) clip.getY(), |
|
|
|
(float) clip.getRight(), |
|
|
|
(float) clip.getBottom(), |
|
|
|
jlimit (0, 255, roundToInt (opacity * 255.0f)), |
|
|
|
31 /*ALL_SAVE_FLAG*/); |
|
|
|
|
|
|
|
stateStack.add (new SavedState (*currentState)); |
|
|
|
} |
|
|
|
|
|
|
|
void endTransparencyLayer() |
|
|
|
{ |
|
|
|
// TODO xxx |
|
|
|
restoreState(); |
|
|
|
} |
|
|
|
|
|
|
|
class SavedState |
|
|
|
{ |
|
|
|
public: |
|
|
|
SavedState() |
|
|
|
: font (1.0f), fillNeedsUpdate (true), typefaceNeedsUpdate (true) |
|
|
|
: font (1.0f), quality (Graphics::highResamplingQuality), |
|
|
|
fillNeedsUpdate (true), typefaceNeedsUpdate (true) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
SavedState (const SavedState& other) |
|
|
|
: fillType (other.fillType), font (other.font), fillNeedsUpdate (true), typefaceNeedsUpdate (true) |
|
|
|
: fillType (other.fillType), font (other.font), quality (other.quality), |
|
|
|
fillNeedsUpdate (true), typefaceNeedsUpdate (true) |
|
|
|
{ |
|
|
|
} |
|
|
|
|
|
|
|
@@ -281799,6 +281828,16 @@ public: |
|
|
|
fillType.colour = fillType.colour.withAlpha (alpha); |
|
|
|
} |
|
|
|
|
|
|
|
void setInterpolationQuality (Graphics::ResamplingQuality quality_) |
|
|
|
{ |
|
|
|
if (quality != quality_) |
|
|
|
{ |
|
|
|
quality = quality_; |
|
|
|
fillNeedsUpdate = true; |
|
|
|
paint.clear(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
jobject getPaint() |
|
|
|
{ |
|
|
|
if (fillNeedsUpdate) |
|
|
|
@@ -281806,7 +281845,7 @@ public: |
|
|
|
JNIEnv* env = getEnv(); |
|
|
|
|
|
|
|
if (paint.get() == 0) |
|
|
|
paint = GlobalRef (android.createPaint()); |
|
|
|
paint = GlobalRef (android.createPaint (quality)); |
|
|
|
|
|
|
|
if (fillType.isColour()) |
|
|
|
{ |
|
|
|
@@ -281890,6 +281929,11 @@ public: |
|
|
|
{ |
|
|
|
paint.callObjectMethod (android.setTypeface, atf->typeface.get()); |
|
|
|
paint.callVoidMethod (android.setTextSize, font.getHeight()); |
|
|
|
|
|
|
|
const float hScale = font.getHorizontalScale(); |
|
|
|
|
|
|
|
if (hScale < 0.99f || hScale > 1.01f) |
|
|
|
paint.callVoidMethod (android.setTextScaleX, hScale); |
|
|
|
} |
|
|
|
|
|
|
|
fillNeedsUpdate = true; |
|
|
|
@@ -281911,6 +281955,7 @@ public: |
|
|
|
Font font; |
|
|
|
GlobalRef paint; |
|
|
|
bool fillNeedsUpdate, typefaceNeedsUpdate; |
|
|
|
Graphics::ResamplingQuality quality; |
|
|
|
}; |
|
|
|
|
|
|
|
private: |
|
|
|
|