这篇教程C++ GR_STATIC_ASSERT函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中GR_STATIC_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ GR_STATIC_ASSERT函数的具体用法?C++ GR_STATIC_ASSERT怎么用?C++ GR_STATIC_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了GR_STATIC_ASSERT函数的29个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: sample_offset_array_namestatic const char* sample_offset_array_name(GrGLSLFPFragmentBuilder::Coordinates coords) { static const char* kArrayNames[] = { "deviceSpaceSampleOffsets", "windowSpaceSampleOffsets" }; return kArrayNames[coords]; GR_STATIC_ASSERT(0 == GrGLSLFPFragmentBuilder::kSkiaDevice_Coordinates); GR_STATIC_ASSERT(1 == GrGLSLFPFragmentBuilder::kGLSLWindow_Coordinates); GR_STATIC_ASSERT(SK_ARRAY_COUNT(kArrayNames) == GrGLSLFPFragmentBuilder::kLast_Coordinates + 1);}
开发者ID:aseprite,项目名称:skia,代码行数:11,
示例2: tile_to_vk_sampler_addressstatic inline VkSamplerAddressMode tile_to_vk_sampler_address(SkShader::TileMode tm) { static const VkSamplerAddressMode gWrapModes[] = { VK_SAMPLER_ADDRESS_MODE_CLAMP_TO_EDGE, VK_SAMPLER_ADDRESS_MODE_REPEAT, VK_SAMPLER_ADDRESS_MODE_MIRRORED_REPEAT }; GR_STATIC_ASSERT(SkShader::kTileModeCount == SK_ARRAY_COUNT(gWrapModes)); GR_STATIC_ASSERT(0 == SkShader::kClamp_TileMode); GR_STATIC_ASSERT(1 == SkShader::kRepeat_TileMode); GR_STATIC_ASSERT(2 == SkShader::kMirror_TileMode); return gWrapModes[tm];}
开发者ID:03050903,项目名称:skia,代码行数:12,
示例3: GR_STATIC_ASSERTGrPathRenderer* GrPathRendererChain::getPathRenderer(const GrDrawTarget* target, const GrPipelineBuilder* pipelineBuilder, const SkMatrix& viewMatrix, const SkPath& path, const GrStrokeInfo& stroke, DrawType drawType, StencilSupport* stencilSupport) { if (!fInit) { this->init(); } bool antiAlias = (kColorAntiAlias_DrawType == drawType || kStencilAndColorAntiAlias_DrawType == drawType); GR_STATIC_ASSERT(GrPathRenderer::kNoSupport_StencilSupport < GrPathRenderer::kStencilOnly_StencilSupport); GR_STATIC_ASSERT(GrPathRenderer::kStencilOnly_StencilSupport < GrPathRenderer::kNoRestriction_StencilSupport); GrPathRenderer::StencilSupport minStencilSupport; if (kStencilOnly_DrawType == drawType) { minStencilSupport = GrPathRenderer::kStencilOnly_StencilSupport; } else if (kStencilAndColor_DrawType == drawType || kStencilAndColorAntiAlias_DrawType == drawType) { minStencilSupport = GrPathRenderer::kNoRestriction_StencilSupport; } else { minStencilSupport = GrPathRenderer::kNoSupport_StencilSupport; } for (int i = 0; i < fChain.count(); ++i) { GrPathRenderer::CanDrawPathArgs args; args.fShaderCaps = target->caps()->shaderCaps(); args.fPipelineBuilder = pipelineBuilder; args.fViewMatrix = &viewMatrix; args.fPath = &path; args.fStroke = &stroke; args.fAntiAlias = antiAlias; if (fChain[i]->canDrawPath(args)) { if (GrPathRenderer::kNoSupport_StencilSupport != minStencilSupport) { GrPathRenderer::StencilSupport support = fChain[i]->getStencilSupport(path, stroke); if (support < minStencilSupport) { continue; } else if (stencilSupport) { *stencilSupport = support; } } return fChain[i]; } } return NULL;}
开发者ID:webbjiang,项目名称:skia,代码行数:51,
示例4: draw_face_to_vk_cull_modeVkCullModeFlags draw_face_to_vk_cull_mode(GrPipelineBuilder::DrawFace drawFace) { // Assumes that we've set the front face to be ccw static const VkCullModeFlags gTable[] = { VK_CULL_MODE_NONE, // kBoth_DrawFace VK_CULL_MODE_BACK_BIT, // kCCW_DrawFace, cull back face VK_CULL_MODE_FRONT_BIT, // kCW_DrawFace, cull front face }; GR_STATIC_ASSERT(0 == GrPipelineBuilder::kBoth_DrawFace); GR_STATIC_ASSERT(1 == GrPipelineBuilder::kCCW_DrawFace); GR_STATIC_ASSERT(2 == GrPipelineBuilder::kCW_DrawFace); SkASSERT((unsigned)drawFace <= 2); return gTable[drawFace];}
开发者ID:nicholas-yangding,项目名称:skia,代码行数:14,
示例5: path_key_from_data_size// If the path is small enough to be keyed from its data this returns key length, otherwise -1.static int path_key_from_data_size(const SkPath& path) { const int verbCnt = path.countVerbs(); if (verbCnt > GrShape::kMaxKeyFromDataVerbCnt) { return -1; } const int pointCnt = path.countPoints(); const int conicWeightCnt = SkPathPriv::ConicWeightCnt(path); GR_STATIC_ASSERT(sizeof(SkPoint) == 2 * sizeof(uint32_t)); GR_STATIC_ASSERT(sizeof(SkScalar) == sizeof(uint32_t)); // 2 is for the verb cnt and a fill type. Each verb is a byte but we'll pad the verb data out to // a uint32_t length. return 2 + (SkAlign4(verbCnt) >> 2) + 2 * pointCnt + conicWeightCnt;}
开发者ID:molikto,项目名称:Skia,代码行数:15,
示例6: blend_equation_to_vk_blend_opstatic VkBlendOp blend_equation_to_vk_blend_op(GrBlendEquation equation) { static const VkBlendOp gTable[] = { VK_BLEND_OP_ADD, // kAdd_GrBlendEquation VK_BLEND_OP_SUBTRACT, // kSubtract_GrBlendEquation VK_BLEND_OP_REVERSE_SUBTRACT, // kReverseSubtract_GrBlendEquation }; GR_STATIC_ASSERT(SK_ARRAY_COUNT(gTable) == kFirstAdvancedGrBlendEquation); GR_STATIC_ASSERT(0 == kAdd_GrBlendEquation); GR_STATIC_ASSERT(1 == kSubtract_GrBlendEquation); GR_STATIC_ASSERT(2 == kReverseSubtract_GrBlendEquation); SkASSERT((unsigned)equation < kGrBlendCoeffCnt); return gTable[equation];}
开发者ID:nicholas-yangding,项目名称:skia,代码行数:14,
示例7: GrPrintfvoid GrGLCaps::print() const { INHERITED::print(); GrPrintf("--- GL-Specific ---/n"); for (int i = 0; i < fStencilFormats.count(); ++i) { GrPrintf("Stencil Format %d, stencil bits: %02d, total bits: %02d/n", i, fStencilFormats[i].fStencilBits, fStencilFormats[i].fTotalBits); } GR_STATIC_ASSERT(0 == kNone_MSFBOType); GR_STATIC_ASSERT(1 == kDesktopARB_MSFBOType); GR_STATIC_ASSERT(2 == kDesktopEXT_MSFBOType); GR_STATIC_ASSERT(3 == kAppleES_MSFBOType); GR_STATIC_ASSERT(4 == kImaginationES_MSFBOType); static const char* gMSFBOExtStr[] = { "None", "ARB", "EXT", "Apple", "IMG", }; GrPrintf("MSAA Type: %s/n", gMSFBOExtStr[fMSFBOType]); GrPrintf("Max FS Uniform Vectors: %d/n", fMaxFragmentUniformVectors); GrPrintf("Max Vertex Attributes: %d/n", fMaxVertexAttributes); GrPrintf("Support RGBA8 Render Buffer: %s/n", (fRGBA8RenderbufferSupport ? "YES": "NO")); GrPrintf("BGRA support: %s/n", (fBGRAFormatSupport ? "YES": "NO")); GrPrintf("BGRA is an internal format: %s/n", (fBGRAIsInternalFormat ? "YES": "NO")); GrPrintf("Support texture swizzle: %s/n", (fTextureSwizzleSupport ? "YES": "NO")); GrPrintf("Unpack Row length support: %s/n", (fUnpackRowLengthSupport ? "YES": "NO")); GrPrintf("Unpack Flip Y support: %s/n", (fUnpackFlipYSupport ? "YES": "NO")); GrPrintf("Pack Row length support: %s/n", (fPackRowLengthSupport ? "YES": "NO")); GrPrintf("Pack Flip Y support: %s/n", (fPackFlipYSupport ? "YES": "NO")); GrPrintf("Texture Usage support: %s/n", (fTextureUsageSupport ? "YES": "NO")); GrPrintf("Texture Storage support: %s/n", (fTexStorageSupport ? "YES": "NO")); GrPrintf("GL_R support: %s/n", (fTextureRedSupport ? "YES": "NO")); GrPrintf("GL_ARB_imaging support: %s/n", (fImagingSupport ? "YES": "NO")); GrPrintf("Two Format Limit: %s/n", (fTwoFormatLimit ? "YES": "NO")); GrPrintf("Fragment coord conventions support: %s/n", (fFragCoordsConventionSupport ? "YES": "NO")); GrPrintf("Vertex array object support: %s/n", (fVertexArrayObjectSupport ? "YES": "NO")); GrPrintf("Use non-VBO for dynamic data: %s/n", (fUseNonVBOVertexAndIndexDynamicData ? "YES" : "NO")); GrPrintf("Core Profile: %s/n", (fIsCoreProfile ? "YES" : "NO")); GrPrintf("Discard FrameBuffer support: %s/n", (fDiscardFBSupport ? "YES" : "NO"));}
开发者ID:JoKaWare,项目名称:GViews,代码行数:49,
示例8: setup_quad_index_bufferstatic uint32_t setup_quad_index_buffer(const GrGLInterface* gl) { static const int kMaxQuads = 1;//1 << 12; // max possible: (1 << 14) - 1; GR_STATIC_ASSERT(4 * kMaxQuads <= 65535); static const uint16_t kPattern[] = { 0, 1, 2, 0, 2, 3 }; static const int kPatternSize = 6; static const int kVertCount = 4; static const int kIndicesCount = kPatternSize * kMaxQuads; int size = kPatternSize * kMaxQuads * sizeof(uint16_t); uint16_t* data = SkNEW_ARRAY(uint16_t, kMaxQuads * kPatternSize); for (int i = 0; i < kMaxQuads; ++i) { int baseIdx = i * kPatternSize; uint16_t baseVert = (uint16_t)(i * kVertCount); for (int j = 0; j < kPatternSize; ++j) { data[baseIdx+j] = baseVert + kPattern[j]; } } GrGLuint quadIBO; GR_GL_CALL(gl, GenBuffers(1, &quadIBO)); GR_GL_CALL(gl, BindBuffer(GR_GL_ELEMENT_ARRAY_BUFFER, quadIBO)); GR_GL_CALL(gl, BufferData(GR_GL_ELEMENT_ARRAY_BUFFER, size, data, GR_GL_STATIC_DRAW)); SkDELETE_ARRAY(data); return kIndicesCount;}
开发者ID:ReyCG,项目名称:skia,代码行数:27,
示例9: buffer_type_to_heapstatic GrVkGpu::Heap buffer_type_to_heap(GrVkBuffer::Type type) { const GrVkGpu::Heap kBufferToHeap[] { GrVkGpu::kVertexBuffer_Heap, GrVkGpu::kIndexBuffer_Heap, GrVkGpu::kUniformBuffer_Heap, GrVkGpu::kCopyReadBuffer_Heap, GrVkGpu::kCopyWriteBuffer_Heap, }; GR_STATIC_ASSERT(0 == GrVkBuffer::kVertex_Type); GR_STATIC_ASSERT(1 == GrVkBuffer::kIndex_Type); GR_STATIC_ASSERT(2 == GrVkBuffer::kUniform_Type); GR_STATIC_ASSERT(3 == GrVkBuffer::kCopyRead_Type); GR_STATIC_ASSERT(4 == GrVkBuffer::kCopyWrite_Type); return kBufferToHeap[type];}
开发者ID:rlugojr,项目名称:skia,代码行数:16,
示例10: get_blend_info_keyuint32_t get_blend_info_key(const GrPipeline& pipeline) { GrXferProcessor::BlendInfo blendInfo; pipeline.getXferProcessor().getBlendInfo(&blendInfo); static const uint32_t kBlendWriteShift = 1; static const uint32_t kBlendCoeffShift = 5; GR_STATIC_ASSERT(kLast_GrBlendCoeff < (1 << kBlendCoeffShift)); GR_STATIC_ASSERT(kFirstAdvancedGrBlendEquation - 1 < 4); uint32_t key = blendInfo.fWriteColor; key |= (blendInfo.fSrcBlend << kBlendWriteShift); key |= (blendInfo.fDstBlend << (kBlendWriteShift + kBlendCoeffShift)); key |= (blendInfo.fEquation << (kBlendWriteShift + 2 * kBlendCoeffShift)); return key;}
开发者ID:C-Tillion,项目名称:skia,代码行数:16,
示例11: GR_STATIC_ASSERTvoid GrGLConvexPolyEffect::GenKey(const GrProcessor& processor, const GrGLSLCaps&, GrProcessorKeyBuilder* b) { const GrConvexPolyEffect& cpe = processor.cast<GrConvexPolyEffect>(); GR_STATIC_ASSERT(kGrProcessorEdgeTypeCnt <= 8); uint32_t key = (cpe.getEdgeCount() << 3) | cpe.getEdgeType(); b->add32(key);}
开发者ID:china20,项目名称:skia,代码行数:7,
示例12: blend_coeff_refs_constantbool blend_coeff_refs_constant(GrBlendCoeff coeff) { static const bool gCoeffReferencesBlendConst[] = { false, false, false, false, false, false, false, false, false, false, true, true, true, true, // extended blend coeffs false, false, false, false, }; return gCoeffReferencesBlendConst[coeff]; GR_STATIC_ASSERT(kGrBlendCoeffCnt == SK_ARRAY_COUNT(gCoeffReferencesBlendConst)); // Individual enum asserts already made in blend_coeff_to_vk_blend}
开发者ID:nicholas-yangding,项目名称:skia,代码行数:27,
示例13: GR_STATIC_ASSERTconst GrIndexBuffer* GrResourceProvider::createQuadIndexBuffer() { static const int kMaxQuads = 1 << 12; // max possible: (1 << 14) - 1; GR_STATIC_ASSERT(4 * kMaxQuads <= 65535); static const uint16_t kPattern[] = { 0, 1, 2, 0, 2, 3 }; return this->createInstancedIndexBuffer(kPattern, 6, kMaxQuads, 4, fQuadIndexBufferKey);}
开发者ID:Nazi-Nigger,项目名称:gecko-dev,代码行数:7,
示例14: GR_STATIC_ASSERTGrResourceKey GrTexture::ComputeScratchKey(const GrTextureDesc& desc) { GrCacheID::Key idKey; // Instead of a client-provided key of the texture contents we create a key from the // descriptor. GR_STATIC_ASSERT(sizeof(idKey) >= 16); GrAssert(desc.fHeight < (1 << 16)); GrAssert(desc.fWidth < (1 << 16)); idKey.fData32[0] = (desc.fWidth) | (desc.fHeight << 16); idKey.fData32[1] = desc.fConfig | desc.fSampleCnt << 16; idKey.fData32[2] = desc.fFlags; idKey.fData32[3] = resolve_origin(desc); // Only needs 2 bits actually static const int kPadSize = sizeof(idKey) - 16; GR_STATIC_ASSERT(kPadSize >= 0); memset(idKey.fData8 + 16, 0, kPadSize); GrCacheID cacheID(GrResourceKey::ScratchDomain(), idKey); return GrResourceKey(cacheID, texture_resource_type(), 0);}
开发者ID:ConradIrwin,项目名称:gecko-dev,代码行数:18,
示例15: SkASSERTvoid GrLayerCache::initAtlas() { SkASSERT(NULL == fAtlas.get()); GR_STATIC_ASSERT(kNumPlotsX*kNumPlotsX == GrPictureInfo::kNumPlots); SkISize textureSize = SkISize::Make(kAtlasTextureWidth, kAtlasTextureHeight); fAtlas.reset(SkNEW_ARGS(GrAtlas, (fContext->getGpu(), kSkia8888_GrPixelConfig, kRenderTarget_GrSurfaceFlag, textureSize, kNumPlotsX, kNumPlotsY, false)));}
开发者ID:Arternis,项目名称:skia,代码行数:9,
示例16: GR_STATIC_ASSERTGrPathRenderer* GrPathRendererChain::getPathRenderer(const GrDrawTarget* target, const GrPipelineBuilder* pipelineBuilder, const SkMatrix& viewMatrix, const SkPath& path, const SkStrokeRec& stroke, DrawType drawType, StencilSupport* stencilSupport) { if (!fInit) { this->init(); } bool antiAlias = (kColorAntiAlias_DrawType == drawType || kStencilAndColorAntiAlias_DrawType == drawType); GR_STATIC_ASSERT(GrPathRenderer::kNoSupport_StencilSupport < GrPathRenderer::kStencilOnly_StencilSupport); GR_STATIC_ASSERT(GrPathRenderer::kStencilOnly_StencilSupport < GrPathRenderer::kNoRestriction_StencilSupport); GrPathRenderer::StencilSupport minStencilSupport; if (kStencilOnly_DrawType == drawType) { minStencilSupport = GrPathRenderer::kStencilOnly_StencilSupport; } else if (kStencilAndColor_DrawType == drawType || kStencilAndColorAntiAlias_DrawType == drawType) { minStencilSupport = GrPathRenderer::kNoRestriction_StencilSupport; } else { minStencilSupport = GrPathRenderer::kNoSupport_StencilSupport; } for (int i = 0; i < fChain.count(); ++i) { if (fChain[i]->canDrawPath(target, pipelineBuilder, viewMatrix, path, stroke, antiAlias)) { if (GrPathRenderer::kNoSupport_StencilSupport != minStencilSupport) { GrPathRenderer::StencilSupport support = fChain[i]->getStencilSupport(target, pipelineBuilder, path, stroke); if (support < minStencilSupport) { continue; } else if (stencilSupport) { *stencilSupport = support; } } return fChain[i]; } } return NULL;}
开发者ID:Ashu17,项目名称:blackberry,代码行数:44,
示例17: GR_STATIC_ASSERTSkString GrDrawTargetCaps::dump() const { SkString r; static const char* gNY[] = {"NO", "YES"}; r.appendf("8 Bit Palette Support : %s/n", gNY[f8BitPaletteSupport]); r.appendf("MIP Map Support : %s/n", gNY[fMipMapSupport]); r.appendf("NPOT Texture Tile Support : %s/n", gNY[fNPOTTextureTileSupport]); r.appendf("Two Sided Stencil Support : %s/n", gNY[fTwoSidedStencilSupport]); r.appendf("Stencil Wrap Ops Support : %s/n", gNY[fStencilWrapOpsSupport]); r.appendf("HW AA Lines Support : %s/n", gNY[fHWAALineSupport]); r.appendf("Shader Derivative Support : %s/n", gNY[fShaderDerivativeSupport]); r.appendf("Geometry Shader Support : %s/n", gNY[fGeometryShaderSupport]); r.appendf("Dual Source Blending Support : %s/n", gNY[fDualSourceBlendingSupport]); r.appendf("Buffer Lock Support : %s/n", gNY[fBufferLockSupport]); r.appendf("Path Rendering Support : %s/n", gNY[fPathRenderingSupport]); r.appendf("Dst Read In Shader Support : %s/n", gNY[fDstReadInShaderSupport]); r.appendf("Discard Render Target Support: %s/n", gNY[fDiscardRenderTargetSupport]); r.appendf("Reuse Scratch Textures : %s/n", gNY[fReuseScratchTextures]); r.appendf("Gpu Tracing Support : %s/n", gNY[fGpuTracingSupport]); r.appendf("Max Texture Size : %d/n", fMaxTextureSize); r.appendf("Max Render Target Size : %d/n", fMaxRenderTargetSize); r.appendf("Max Sample Count : %d/n", fMaxSampleCount); static const char* kConfigNames[] = { "Unknown", // kUnknown_GrPixelConfig "Alpha8", // kAlpha_8_GrPixelConfig, "Index8", // kIndex_8_GrPixelConfig, "RGB565", // kRGB_565_GrPixelConfig, "RGBA444", // kRGBA_4444_GrPixelConfig, "RGBA8888", // kRGBA_8888_GrPixelConfig, "BGRA8888", // kBGRA_8888_GrPixelConfig, }; GR_STATIC_ASSERT(0 == kUnknown_GrPixelConfig); GR_STATIC_ASSERT(1 == kAlpha_8_GrPixelConfig); GR_STATIC_ASSERT(2 == kIndex_8_GrPixelConfig); GR_STATIC_ASSERT(3 == kRGB_565_GrPixelConfig); GR_STATIC_ASSERT(4 == kRGBA_4444_GrPixelConfig); GR_STATIC_ASSERT(5 == kRGBA_8888_GrPixelConfig); GR_STATIC_ASSERT(6 == kBGRA_8888_GrPixelConfig); GR_STATIC_ASSERT(SK_ARRAY_COUNT(kConfigNames) == kGrPixelConfigCnt); SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][0]); SkASSERT(!fConfigRenderSupport[kUnknown_GrPixelConfig][1]); for (size_t i = 0; i < SK_ARRAY_COUNT(kConfigNames); ++i) { if (i != kUnknown_GrPixelConfig) { r.appendf("%s is renderable: %s, with MSAA: %s/n", kConfigNames[i], gNY[fConfigRenderSupport[i][0]], gNY[fConfigRenderSupport[i][1]]); } } return r;}
开发者ID:danielbak,项目名称:skia,代码行数:52,
示例18: GR_STATIC_ASSERTvoid GrGLSLShaderBuilder::compileAndAppendLayoutQualifiers() { static const char* interfaceQualifierNames[] = { "out" }; for (int interface = 0; interface <= kLastInterfaceQualifier; ++interface) { const SkTArray<SkString>& params = fLayoutParams[interface]; if (params.empty()) { continue; } this->layoutQualifiers().appendf("layout(%s", params[0].c_str()); for (int i = 1; i < params.count(); ++i) { this->layoutQualifiers().appendf(", %s", params[i].c_str()); } this->layoutQualifiers().appendf(") %s;/n", interfaceQualifierNames[interface]); } GR_STATIC_ASSERT(0 == GrGLSLShaderBuilder::kOut_InterfaceQualifier); GR_STATIC_ASSERT(SK_ARRAY_COUNT(interfaceQualifierNames) == kLastInterfaceQualifier + 1);}
开发者ID:MichaelKohler,项目名称:gecko-dev,代码行数:20,
示例19: GR_STATIC_ASSERTGrPathRenderer* GrPathRendererChain::getPathRenderer( const GrPathRenderer::CanDrawPathArgs& args, DrawType drawType, GrPathRenderer::StencilSupport* stencilSupport) { GR_STATIC_ASSERT(GrPathRenderer::kNoSupport_StencilSupport < GrPathRenderer::kStencilOnly_StencilSupport); GR_STATIC_ASSERT(GrPathRenderer::kStencilOnly_StencilSupport < GrPathRenderer::kNoRestriction_StencilSupport); GrPathRenderer::StencilSupport minStencilSupport; if (kStencilOnly_DrawType == drawType) { minStencilSupport = GrPathRenderer::kStencilOnly_StencilSupport; } else if (kStencilAndColor_DrawType == drawType || kStencilAndColorAntiAlias_DrawType == drawType) { minStencilSupport = GrPathRenderer::kNoRestriction_StencilSupport; } else { minStencilSupport = GrPathRenderer::kNoSupport_StencilSupport; } if (minStencilSupport != GrPathRenderer::kNoSupport_StencilSupport) { // We don't support (and shouldn't need) stenciling of non-fill paths. if (!args.fStyle->isSimpleFill()) { return nullptr; } } for (int i = 0; i < fChain.count(); ++i) { if (fChain[i]->canDrawPath(args)) { if (GrPathRenderer::kNoSupport_StencilSupport != minStencilSupport) { GrPathRenderer::StencilSupport support = fChain[i]->getStencilSupport(*args.fPath); if (support < minStencilSupport) { continue; } else if (stencilSupport) { *stencilSupport = support; } } return fChain[i]; } } return nullptr;}
开发者ID:C-Tillion,项目名称:skia,代码行数:40,
示例20: fContextSkMesaGLContext::SkMesaGLContext() : fContext(static_cast<Context>(NULL)) , fImage(NULL) { GR_STATIC_ASSERT(sizeof(Context) == sizeof(OSMesaContext)); /* Create an RGBA-mode context */#if OSMESA_MAJOR_VERSION * 100 + OSMESA_MINOR_VERSION >= 305 /* specify Z, stencil, accum sizes */ fContext = (Context)OSMesaCreateContextExt(OSMESA_BGRA, 0, 0, 0, NULL);#else fContext = (Context)OSMesaCreateContext(OSMESA_BGRA, NULL);#endif if (!fContext) { SkDebugf("OSMesaCreateContext failed!/n"); this->destroyGLContext(); return; } // Allocate the image buffer fImage = (GrGLubyte *) sk_malloc_throw(gBOGUS_SIZE * gBOGUS_SIZE * 4 * sizeof(GrGLubyte)); if (!fImage) { SkDebugf("Alloc image buffer failed!/n"); this->destroyGLContext(); return; } // Bind the buffer to the context and make it current if (!OSMesaMakeCurrent((OSMesaContext)fContext, fImage, GR_GL_UNSIGNED_BYTE, gBOGUS_SIZE, gBOGUS_SIZE)) { SkDebugf("OSMesaMakeCurrent failed!/n"); this->destroyGLContext(); return; } SkAutoTUnref<const GrGLInterface> gl(GrGLCreateMesaInterface()); if (NULL == gl.get()) { SkDebugf("Could not create GL interface!/n"); this->destroyGLContext(); return; } if (!gl->validate()) { SkDebugf("Could not validate GL interface!/n"); this->destroyGLContext(); return; } this->init(gl.detach());}
开发者ID:mariospr,项目名称:chromium-browser,代码行数:52,
示例21: GenKey static void GenKey(const GrXferProcessor& p, const GrGLSLCaps& caps, GrProcessorKeyBuilder* b) { const CustomXP& xp = p.cast<CustomXP>(); uint32_t key = 0; if (xp.hasHWBlendEquation()) { SkASSERT(caps.advBlendEqInteraction() > 0); // 0 will mean !xp.hasHWBlendEquation(). key |= caps.advBlendEqInteraction(); GR_STATIC_ASSERT(GrGLSLCaps::kLast_AdvBlendEqInteraction < 4); } if (!xp.hasHWBlendEquation() || caps.mustEnableSpecificAdvBlendEqs()) { key |= xp.mode() << 3; } b->add32(key); }
开发者ID:Crawping,项目名称:chromium_extract,代码行数:13,
示例22: GrAssertint GrDrawTarget::VertexTexCoordsForStage(int stage, GrVertexLayout vertexLayout) { GrAssert(stage < kNumStages); GrAssert(check_layout(vertexLayout)); int bit = vertexLayout & stage_tex_coord_mask(stage); if (bit) { // figure out which set of texture coordates is used // bits are ordered T0S0, T0S1, T0S2, ..., T1S0, T1S1, ... // and start at bit 0. GR_STATIC_ASSERT(sizeof(GrVertexLayout) <= sizeof(uint32_t)); return (32 - Gr_clz(bit) - 1) / kNumStages; } return -1;}
开发者ID:Beifeng,项目名称:WTL-DUI,代码行数:13,
示例23: GR_STATIC_ASSERTSkString GrGLSLCaps::dump() const { SkString r = INHERITED::dump(); static const char* kAdvBlendEqInteractionStr[] = { "Not Supported", "Automatic", "General Enable", "Specific Enables", }; GR_STATIC_ASSERT(0 == kNotSupported_AdvBlendEqInteraction); GR_STATIC_ASSERT(1 == kAutomatic_AdvBlendEqInteraction); GR_STATIC_ASSERT(2 == kGeneralEnable_AdvBlendEqInteraction); GR_STATIC_ASSERT(3 == kSpecificEnables_AdvBlendEqInteraction); GR_STATIC_ASSERT(SK_ARRAY_COUNT(kAdvBlendEqInteractionStr) == kLast_AdvBlendEqInteraction + 1); r.appendf("--- GLSL-Specific ---/n"); r.appendf("FB Fetch Support: %s/n", (fFBFetchSupport ? "YES" : "NO")); r.appendf("Drops tile on zero divide: %s/n", (fDropsTileOnZeroDivide ? "YES" : "NO")); r.appendf("Advanced blend equation interaction: %s/n", kAdvBlendEqInteractionStr[fAdvBlendEqInteraction]); return r;}
开发者ID:rickdynasty,项目名称:platform_external_skia,代码行数:23,
示例24: switchint GrShape::unstyledKeySize() const { if (fInheritedKey.count()) { return fInheritedKey.count(); } switch (fType) { case Type::kEmpty: return 1; case Type::kInvertedEmpty: return 1; case Type::kRRect: SkASSERT(!fInheritedKey.count()); GR_STATIC_ASSERT(0 == SkRRect::kSizeInMemory % sizeof(uint32_t)); // + 1 for the direction, start index, and inverseness. return SkRRect::kSizeInMemory / sizeof(uint32_t) + 1; case Type::kArc: SkASSERT(!fInheritedKey.count()); GR_STATIC_ASSERT(0 == sizeof(fArcData) % sizeof(uint32_t)); return sizeof(fArcData) / sizeof(uint32_t); case Type::kLine: GR_STATIC_ASSERT(2 * sizeof(uint32_t) == sizeof(SkPoint)); // 4 for the end points and 1 for the inverseness return 5; case Type::kPath: { if (0 == fPathData.fGenID) { return -1; } int dataKeySize = path_key_from_data_size(fPathData.fPath); if (dataKeySize >= 0) { return dataKeySize; } // The key is the path ID and fill type. return 2; } } SK_ABORT("Should never get here."); return 0;}
开发者ID:molikto,项目名称:Skia,代码行数:37,
示例25: GrPrintfvoid GrGLCaps::print() const { for (int i = 0; i < fStencilFormats.count(); ++i) { GrPrintf("Stencil Format %d, stencil bits: %02d, total bits: %02d/n", i, fStencilFormats[i].fStencilBits, fStencilFormats[i].fTotalBits); } GR_STATIC_ASSERT(0 == kNone_MSFBOType); GR_STATIC_ASSERT(1 == kDesktopARB_MSFBOType); GR_STATIC_ASSERT(2 == kDesktopEXT_MSFBOType); GR_STATIC_ASSERT(3 == kAppleES_MSFBOType); static const char* gMSFBOExtStr[] = { "None", "ARB", "EXT", "Apple", }; GrPrintf("MSAA Type: %s/n", gMSFBOExtStr[fMSFBOType]); GrPrintf("Max FS Uniform Vectors: %d/n", fMaxFragmentUniformVectors); GrPrintf("Support RGBA8 Render Buffer: %s/n", (fRGBA8RenderbufferSupport ? "YES": "NO")); GrPrintf("BGRA is an internal format: %s/n", (fBGRAIsInternalFormat ? "YES": "NO")); GrPrintf("Support texture swizzle: %s/n", (fTextureSwizzleSupport ? "YES": "NO")); GrPrintf("Unpack Row length support: %s/n", (fUnpackRowLengthSupport ? "YES": "NO")); GrPrintf("Unpack Flip Y support: %s/n", (fUnpackFlipYSupport ? "YES": "NO")); GrPrintf("Pack Row length support: %s/n", (fPackRowLengthSupport ? "YES": "NO")); GrPrintf("Pack Flip Y support: %s/n", (fPackFlipYSupport ? "YES": "NO")); GrPrintf("Two Format Limit: %s/n", (fTwoFormatLimit ? "YES": "NO")); GrPrintf("Fragment coord conventions support: %s/n", (fFragCoordsConventionSupport ? "YES": "NO"));}
开发者ID:bunhere,项目名称:skia,代码行数:37,
示例26: getIndexBuffer const GrIndexBuffer* getIndexBuffer(GrResourceProvider* resourceProvider) { GR_DEFINE_STATIC_UNIQUE_KEY(gAAFillRectIndexBufferKey); static const uint16_t gFillAARectIdx[] = { 0, 1, 5, 5, 4, 0, 1, 2, 6, 6, 5, 1, 2, 3, 7, 7, 6, 2, 3, 0, 4, 4, 7, 3, 4, 5, 6, 6, 7, 4, }; GR_STATIC_ASSERT(SK_ARRAY_COUNT(gFillAARectIdx) == kIndicesPerAAFillRect); return resourceProvider->refOrCreateInstancedIndexBuffer(gFillAARectIdx, kIndicesPerAAFillRect, kNumAAFillRectsInIndexBuffer, kVertsPerAAFillRect, gAAFillRectIndexBufferKey); }
开发者ID:Jichao,项目名称:skia,代码行数:15,
示例27: sampler_keystatic uint16_t sampler_key(GrSLType samplerType, GrPixelConfig config, GrShaderFlags visibility, const GrGLSLCaps& caps) { enum { kFirstSamplerType = kSampler2D_GrSLType, kLastSamplerType = kSamplerBuffer_GrSLType, kSamplerTypeKeyBits = 4 }; GR_STATIC_ASSERT(kLastSamplerType - kFirstSamplerType < (1 << kSamplerTypeKeyBits)); SkASSERT((int)samplerType >= kFirstSamplerType && (int)samplerType <= kLastSamplerType); int samplerTypeKey = samplerType - kFirstSamplerType; return SkToU16(caps.configTextureSwizzle(config).asKey() | (samplerTypeKey << 8) | (caps.samplerPrecision(config, visibility) << (8 + kSamplerTypeKeyBits)));}
开发者ID:BertiKarsunke,项目名称:skia,代码行数:16,
示例28: stencil_op_to_vk_stencil_opVkStencilOp stencil_op_to_vk_stencil_op(GrStencilOp op) { static const VkStencilOp gTable[] = { VK_STENCIL_OP_KEEP, // kKeep_StencilOp VK_STENCIL_OP_REPLACE, // kReplace_StencilOp VK_STENCIL_OP_INCREMENT_AND_WRAP, // kIncWrap_StencilOp VK_STENCIL_OP_INCREMENT_AND_CLAMP, // kIncClamp_StencilOp VK_STENCIL_OP_DECREMENT_AND_WRAP, // kDecWrap_StencilOp VK_STENCIL_OP_DECREMENT_AND_CLAMP, // kDecClamp_StencilOp VK_STENCIL_OP_ZERO, // kZero_StencilOp VK_STENCIL_OP_INVERT, // kInvert_StencilOp }; GR_STATIC_ASSERT(SK_ARRAY_COUNT(gTable) == kStencilOpCount); GR_STATIC_ASSERT(0 == kKeep_StencilOp); GR_STATIC_ASSERT(1 == kReplace_StencilOp); GR_STATIC_ASSERT(2 == kIncWrap_StencilOp); GR_STATIC_ASSERT(3 == kIncClamp_StencilOp); GR_STATIC_ASSERT(4 == kDecWrap_StencilOp); GR_STATIC_ASSERT(5 == kDecClamp_StencilOp); GR_STATIC_ASSERT(6 == kZero_StencilOp); GR_STATIC_ASSERT(7 == kInvert_StencilOp); SkASSERT((unsigned)op < kStencilOpCount); return gTable[op];}
开发者ID:nicholas-yangding,项目名称:skia,代码行数:23,
示例29: stencil_op_to_vk_stencil_opVkStencilOp stencil_op_to_vk_stencil_op(GrStencilOp op) { static const VkStencilOp gTable[] = { VK_STENCIL_OP_KEEP, // kKeep VK_STENCIL_OP_ZERO, // kZero VK_STENCIL_OP_REPLACE, // kReplace VK_STENCIL_OP_INVERT, // kInvert VK_STENCIL_OP_INCREMENT_AND_WRAP, // kIncWrap VK_STENCIL_OP_DECREMENT_AND_WRAP, // kDecWrap VK_STENCIL_OP_INCREMENT_AND_CLAMP, // kIncClamp VK_STENCIL_OP_DECREMENT_AND_CLAMP, // kDecClamp }; GR_STATIC_ASSERT(SK_ARRAY_COUNT(gTable) == kGrStencilOpCount); GR_STATIC_ASSERT(0 == (int)GrStencilOp::kKeep); GR_STATIC_ASSERT(1 == (int)GrStencilOp::kZero); GR_STATIC_ASSERT(2 == (int)GrStencilOp::kReplace); GR_STATIC_ASSERT(3 == (int)GrStencilOp::kInvert); GR_STATIC_ASSERT(4 == (int)GrStencilOp::kIncWrap); GR_STATIC_ASSERT(5 == (int)GrStencilOp::kDecWrap); GR_STATIC_ASSERT(6 == (int)GrStencilOp::kIncClamp); GR_STATIC_ASSERT(7 == (int)GrStencilOp::kDecClamp); SkASSERT(op < (GrStencilOp)kGrStencilOpCount); return gTable[(int)op];}
开发者ID:OwenTan,项目名称:skia,代码行数:23,
注:本文中的GR_STATIC_ASSERT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ GS函数代码示例 C++ GR_GL_VER函数代码示例 |