本文整理汇总了C++中SkRegion::isComplex方法的典型用法代码示例。如果您正苦于以下问题:C++ SkRegion::isComplex方法的具体用法?C++ SkRegion::isComplex怎么用?C++ SkRegion::isComplex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkRegion
的用法示例。
在下文中一共展示了SkRegion::isComplex方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawQuads
void SkGLDrawProcs::drawQuads() {
SkASSERT(SK_ARRAY_COUNT(gQuadIndices) == MAX_QUADS * 6);
glBindTexture(GL_TEXTURE_2D, fCurrTexture);
#if 0
static bool gOnce;
if (!gOnce) {
generateQuadIndices(MAX_QUADS);
gOnce = true;
}
#endif
// convert from quad vertex count to triangle vertex count
// 6/4 * n == n + (n >> 1) since n is always a multiple of 4
SkASSERT((fCurrQuad & 3) == 0);
int count = fCurrQuad + (fCurrQuad >> 1);
if (fClip->isComplex()) {
SkGLClipIter iter(fViewportHeight);
iter.reset(*fClip);
while (!iter.done()) {
iter.scissor();
glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_BYTE, gQuadIndices);
iter.next();
}
} else {
glDrawElements(GL_TRIANGLES, count, GL_UNSIGNED_BYTE, gQuadIndices);
}
}
示例2: toString
static void toString(const SkRegion& rgn, SkString* str) {
str->append("Region:[");
toString(rgn.getBounds(), str);
str->append("]");
if (rgn.isComplex()) {
str->append(".complex");
}
}
示例3: Surface_setTransparentRegion
static void Surface_setTransparentRegion(
JNIEnv* env, jobject clazz, jobject argRegion)
{
const sp<SurfaceControl>& surface(getSurfaceControl(env, clazz));
if (surface == 0) return;
SkRegion* nativeRegion = (SkRegion*)env->GetIntField(argRegion, no.native_region);
const SkIRect& b(nativeRegion->getBounds());
Region reg(Rect(b.fLeft, b.fTop, b.fRight, b.fBottom));
if (nativeRegion->isComplex()) {
SkRegion::Iterator it(*nativeRegion);
while (!it.done()) {
const SkIRect& r(it.rect());
reg.addRectUnchecked(r.fLeft, r.fTop, r.fRight, r.fBottom);
it.next();
}
}
status_t err = surface->setTransparentRegionHint(reg);
if (err<0 && err!=NO_INIT) {
doThrowIAE(env);
}
}
示例4: nativeSetTransparentRegionHint
static void nativeSetTransparentRegionHint(JNIEnv* env, jclass clazz, jlong nativeObject, jobject regionObj) {
SurfaceControl* const ctrl = reinterpret_cast<SurfaceControl *>(nativeObject);
SkRegion* region = android_graphics_Region_getSkRegion(env, regionObj);
if (!region) {
doThrowIAE(env);
return;
}
const SkIRect& b(region->getBounds());
Region reg(Rect(b.fLeft, b.fTop, b.fRight, b.fBottom));
if (region->isComplex()) {
SkRegion::Iterator it(*region);
while (!it.done()) {
const SkIRect& r(it.rect());
reg.addRectUnchecked(r.fLeft, r.fTop, r.fRight, r.fBottom);
it.next();
}
}
status_t err = ctrl->setTransparentRegionHint(reg);
if (err < 0 && err != NO_INIT) {
doThrowIAE(env);
}
}
开发者ID:debian-pkg-android-tools,项目名称:android-platform-frameworks-base,代码行数:24,代码来源:android_view_SurfaceControl.cpp