~ubuntu-branches/ubuntu/utopic/blender/utopic-proposed

« back to all changes in this revision

Viewing changes to source/blender/blenkernel/intern/font.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
41
41
 
42
42
#include "BLI_math.h"
43
43
#include "BLI_blenlib.h"
 
44
#include "BLI_threads.h"
44
45
#include "BLI_vfontdata.h"
45
46
#include "BLI_utildefines.h"
46
47
 
59
60
#include "BKE_curve.h"
60
61
#include "BKE_displist.h"
61
62
 
 
63
static ThreadMutex vfont_mutex = BLI_MUTEX_INITIALIZER;
62
64
 
63
65
/* The vfont code */
64
66
void BKE_vfont_free_data(struct VFont *vfont)
138
140
        if (!vfont->data) {
139
141
                PackedFile *pf;
140
142
 
 
143
                BLI_mutex_lock(&vfont_mutex);
 
144
 
 
145
                if (vfont->data) {
 
146
                        /* Check data again, since it might have been already
 
147
                         * initialized from other thread (previous check is
 
148
                         * not accurate or threading, just prevents unneeded
 
149
                         * lock if all the data is here for sure).
 
150
                         */
 
151
                        BLI_mutex_unlock(&vfont_mutex);
 
152
                        return vfont->data;
 
153
                }
 
154
 
141
155
                if (BKE_vfont_is_builtin(vfont)) {
142
156
                        pf = get_builtin_packedfile();
143
157
                }
175
189
                                freePackedFile(pf);
176
190
                        }
177
191
                }
 
192
 
 
193
                BLI_mutex_unlock(&vfont_mutex);
178
194
        }
179
 
        
 
195
 
180
196
        return vfont->data;
181
197
}
182
198
 
819
835
                
820
836
                cucu->flag |= (CU_PATH + CU_FOLLOW);
821
837
                
822
 
                if (cucu->path == NULL) BKE_displist_make_curveTypes(scene, cu->textoncurve, 0);
823
 
                if (cucu->path) {
 
838
                if (cu->textoncurve->curve_cache == NULL || cu->textoncurve->curve_cache->path == NULL) {
 
839
                        BKE_displist_make_curveTypes(scene, cu->textoncurve, 0);
 
840
                }
 
841
                if (cu->textoncurve->curve_cache->path) {
824
842
                        float distfac, imat[4][4], imat3[3][3], cmat[3][3];
825
843
                        float minx, maxx, miny, maxy;
826
844
                        float timeofs, sizefac;
845
863
                        /* we put the x-coordinaat exact at the curve, the y is rotated */
846
864
                        
847
865
                        /* length correction */
848
 
                        distfac = sizefac * cucu->path->totdist / (maxx - minx);
 
866
                        distfac = sizefac * cu->textoncurve->curve_cache->path->totdist / (maxx - minx);
849
867
                        timeofs = 0.0f;
850
868
                        
851
869
                        if (distfac > 1.0f) {