/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#include "D3DGlyphCache.h"
#include "D3DTextRenderer.h"
#include "D3DRenderQueue.h"
// static
{
delete *ppGlyphCache;
*ppGlyphCache = NULL;
}
return res;
}
{
pGlyphCache = NULL;
}
{
if (pGlyphCache != NULL) {
pGlyphCache = NULL;
}
}
void
{
// REMIND: the glyph cache texture is not in the default pool, so
// this can be optimized not to release the texture
}
{
if (pGlyphCache == NULL) {
// init glyph cache data structure
if (pGlyphCache == NULL) {
"D3DGlyphCache::Init: "\
"could not init D3D glyph cache");
return E_FAIL;
}
}
if (gcType == CACHE_GRAY) {
} else { // gcType == CACHE_LCD
}
"D3DGlyphCache::Init: "\
"could not create glyph cache texture");
}
return res;
}
{
// store glyph image in texture cell
0, 0,
// LCD text rendering optimization: if the number of pixels touched on
// the first or last column of the glyph image is less than 1/3 of the
// height of the glyph we do not consider them touched.
// See D3DTextRenderer.cpp:UpdateCachedDestination for more information.
} else {
}
}
return res;
}
{
" invoked on CACHE_GRAY cache type instance!");
return E_FAIL;
}
if (rgbOrder != lastRGBOrder) {
// need to invalidate the cache in this case; see comments
// for lastRGBOrder
}
return S_OK;
}
/**
* This method is invoked in the (relatively rare) case where one or
* more glyphs is about to be kicked out of the glyph cache texture.
* Here we simply flush the vertex queue of the current context in case
* any pending vertices are dependent upon the current glyph cache layout.
*/
static void
{
d3dc->FlushVertexQueue();
}
}