}
}
-void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes,
+void SkDebuggerGUI::setupOverviewText(const SkTDArray<double>* typeTimes,
double totTime,
int numRuns) {
SkString overview;
}
#ifdef SK_DEBUG
if (NULL != typeTimes) {
- SkASSERT(SkScalarNearlyEqual(SkDoubleToScalar(totPercent),
+ SkASSERT(SkScalarNearlyEqual(SkDoubleToScalar(totPercent),
SkDoubleToScalar(100.0)));
- SkASSERT(SkScalarNearlyEqual(SkDoubleToScalar(tempSum),
+ SkASSERT(SkScalarNearlyEqual(SkDoubleToScalar(tempSum),
SkDoubleToScalar(totTime)));
}
#endif
}
}
- void getOverviewText(const SkTDArray<double>* typeTimes, double totTime,
+ void getOverviewText(const SkTDArray<double>* typeTimes, double totTime,
SkString* overview, int numRuns);
private:
'<(skia_src_path)/gpu/effects/GrTextureDomainEffect.h',
'<(skia_src_path)/gpu/effects/GrTextureStripAtlas.cpp',
'<(skia_src_path)/gpu/effects/GrTextureStripAtlas.h',
-
+
'<(skia_src_path)/gpu/gl/GrGLBufferImpl.cpp',
'<(skia_src_path)/gpu/gl/GrGLBufferImpl.h',
'<(skia_src_path)/gpu/gl/GrGLCaps.cpp',
protected:
/**
- * Subclasses call this from their constructor to register GrTextureAccesses. The effect
- * subclass manages the lifetime of the accesses (this function only stores a pointer). This
+ * Subclasses call this from their constructor to register GrTextureAccesses. The effect
+ * subclass manages the lifetime of the accesses (this function only stores a pointer). This
* must only be called from the constructor because GrEffects are immutable.
*/
void addTextureAccess(const GrTextureAccess* textureAccess);
/**
- * Subclasses call this from their constructor to register vertex attributes (at most
- * kMaxVertexAttribs). This must only be called from the constructor because GrEffects are
+ * Subclasses call this from their constructor to register vertex attributes (at most
+ * kMaxVertexAttribs). This must only be called from the constructor because GrEffects are
* immutable.
*/
void addVertexAttrib(GrSLType type);
return false;
}
- if (!(*stage.getEffect())->isEqual(*fEffect)) {
- return false;
+ if (!(*stage.getEffect())->isEqual(*fEffect)) {
+ return false;
}
return fCoordChangeMatrix == stage.fCoordChangeMatrix;
static const EffectKey kIllegalAttribKeyMask = (uint16_t) (~((1U << kAttribKeyBits) - 1));
GrAssert(!(kIllegalAttribKeyMask & textureKey));
#endif
- return fEffectClassID | (attribKey << (kEffectKeyBits+kTextureKeyBits)) |
+ return fEffectClassID | (attribKey << (kEffectKeyBits+kTextureKeyBits)) |
(textureKey << kEffectKeyBits) | effectKey;
}
void SkFontHost::SetSubpixelOrder(LCDOrder order) {
SkFontLCDConfig::SetSubpixelOrder((SkFontLCDConfig::LCDOrder)order);
}
-
-
}
// CommandInfos are fed to the 'match' method and filled in with command
-// information.
+// information.
struct CommandInfo {
DrawType fActualOp;
uint32_t fOffset;
/*
* Attempt to match the provided pattern of commands starting at 'offset'
- * in the byte stream and stopping at the end of the stream. Upon success,
+ * in the byte stream and stopping at the end of the stream. Upon success,
* return true with all the pattern information filled out in the result
* array (i.e., actual ops, offsets and sizes).
* Note this method skips any NOOPs seen in the stream
const CommandInfo& dbmInfo);
/*
- * Restore has just been called (but not recorded), look back at the
+ * Restore has just been called (but not recorded), look back at the
* matching save* and see if we are in the configuration:
* SAVE_LAYER
* DRAW_BITMAP|DRAW_BITMAP_MATRIX|DRAW_BITMAP_NINE|DRAW_BITMAP_RECT_TO_RECT
const CommandInfo& saveLayerInfo,
const CommandInfo& dbmInfo) {
SkASSERT(SAVE_LAYER == saveLayerInfo.fActualOp);
- SkASSERT(DRAW_BITMAP == dbmInfo.fActualOp ||
+ SkASSERT(DRAW_BITMAP == dbmInfo.fActualOp ||
DRAW_BITMAP_MATRIX == dbmInfo.fActualOp ||
- DRAW_BITMAP_NINE == dbmInfo.fActualOp ||
+ DRAW_BITMAP_NINE == dbmInfo.fActualOp ||
DRAW_BITMAP_RECT_TO_RECT == dbmInfo.fActualOp);
uint32_t dbmPaintOffset = getPaintOffset(dbmInfo.fActualOp, dbmInfo.fSize);
}
/*
- * Restore has just been called (but not recorded), look back at the
+ * Restore has just been called (but not recorded), look back at the
* matching save* and see if we are in the configuration:
* SAVE_LAYER
* SAVE
SkScalar r = SkScalarMul(cc[0], SkGetPackedR32(c0)) + SkScalarMul(cc[1], SkGetPackedR32(c1)) + SkScalarMul(cc[2], SkGetPackedR32(c2)) + SkScalarMul(cc[3], SkGetPackedR32(c3));
SkScalar g = SkScalarMul(cc[0], SkGetPackedG32(c0)) + SkScalarMul(cc[1], SkGetPackedG32(c1)) + SkScalarMul(cc[2], SkGetPackedG32(c2)) + SkScalarMul(cc[3], SkGetPackedG32(c3));
SkScalar b = SkScalarMul(cc[0], SkGetPackedB32(c0)) + SkScalarMul(cc[1], SkGetPackedB32(c1)) + SkScalarMul(cc[2], SkGetPackedB32(c2)) + SkScalarMul(cc[3], SkGetPackedB32(c3));
- return SkPackARGB32(SkScalarRoundToInt(a),
- SkScalarRoundToInt(SkScalarClampMax(r, a)),
- SkScalarRoundToInt(SkScalarClampMax(g, a)),
+ return SkPackARGB32(SkScalarRoundToInt(a),
+ SkScalarRoundToInt(SkScalarClampMax(r, a)),
+ SkScalarRoundToInt(SkScalarClampMax(g, a)),
SkScalarRoundToInt(SkScalarClampMax(b, a)));
}
drawState->setAttribBindings(GrDrawState::kDefault_AttribBindings);
enum {
- // the edge effects share this stage with glyph rendering
- // (kGlyphMaskStage in GrTextContext) && SW path rendering
+ // the edge effects share this stage with glyph rendering
+ // (kGlyphMaskStage in GrTextContext) && SW path rendering
// (kPathMaskStage in GrSWMaskHelper)
kEdgeEffectStage = GrPaint::kTotalStages,
};
}
// sentinel to make sure effects don't try to use built-in attributes
- static const int kBuiltInAttributeType = 10000;
+ static const int kBuiltInAttributeType = 10000;
// check our built-in indices
if (fAttribIndices[kPosition_AttribIndex] >= kVertexAttribCnt) {
}
// now those set by effects
- for (int s = 0; s < kNumStages; ++s) {
+ for (int s = 0; s < kNumStages; ++s) {
const GrEffectStage& stage = fStages[s];
const GrEffectRef* effect = stage.getEffect();
if (effect == NULL) {
}
GrSLType attributeType = effect->get()->vertexAttribType(i);
- if (attributeTypes[attributeIndex] != -1 &&
+ if (attributeTypes[attributeIndex] != -1 &&
attributeTypes[attributeIndex] != attributeType) {
return false;
}
bool hasSolidCoverage(GrAttribBindings) const;
static void VertexAttributesUnitTest();
-
+
/// @}
///////////////////////////////////////////////////////////////////////////
/// @name Effect Stages
////
- const GrEffectRef* setEffect(int stageIdx, const GrEffectRef* effect,
+ const GrEffectRef* setEffect(int stageIdx, const GrEffectRef* effect,
const int* indices = NULL) {
fStages[stageIdx].setEffect(effect, indices);
return effect;
return true;
}
- void disableStage(int stageIdx) {
- this->setEffect(stageIdx, NULL, NULL);
+ void disableStage(int stageIdx) {
+ this->setEffect(stageIdx, NULL, NULL);
}
/**
#include "SkStrokeRec.h"
enum {
- // glyph rendering shares this stage with edge rendering
- // (kEdgeEffectStage in GrContext) && SW path rendering
+ // glyph rendering shares this stage with edge rendering
+ // (kEdgeEffectStage in GrContext) && SW path rendering
// (kPathMaskStage in GrSWMaskHelper)
kGlyphMaskStage = GrPaint::kTotalStages,
};
const SkString* attrName = builder->getEffectAttributeName(stage.getVertexAttribIndices()[0]);
builder->vsCodeAppendf("\t%s = %s;\n", vsName, attrName->c_str());
-
+
builder->fsCodeAppend("\tfloat edgeAlpha;\n");
// translate to origin
builder->fsCodeAppendf("\tvec2 offset = (%s.xy - %s.xy);\n", builder->fragmentPosition(), fsName);
// scale y by xRadius/yRadius
- builder->fsCodeAppendf("\toffset.y *= %s.w;\n", fsName);
+ builder->fsCodeAppendf("\toffset.y *= %s.w;\n", fsName);
builder->fsCodeAppend("\tfloat d = length(offset);\n");
// compare length against xRadius
builder->fsCodeAppendf("\tedgeAlpha = smoothstep(d - 0.5, d + 0.5, %s.z);\n", fsName);
}
const GrGLShaderBuilder::AttributePair* attribEnd = builder.getEffectAttributes().end();
- for (const GrGLShaderBuilder::AttributePair* attrib = builder.getEffectAttributes().begin();
+ for (const GrGLShaderBuilder::AttributePair* attrib = builder.getEffectAttributes().begin();
attrib != attribEnd;
++attrib) {
GL_CALL(BindAttribLocation(fProgramID, attrib->fIndex, attrib->fName.c_str()));
const SkString* GrGLShaderBuilder::getEffectAttributeName(int attributeIndex) const {
const AttributePair* attribEnd = this->getEffectAttributes().end();
- for (const AttributePair* attrib = this->getEffectAttributes().begin();
+ for (const AttributePair* attrib = this->getEffectAttributes().begin();
attrib != attribEnd;
++attrib) {
if (attrib->fIndex == attributeIndex) {
return &attrib->fName;
}
- }
+ }
return NULL;
}
GrGpuGL::ProgramCache::ProgramCache(const GrGLContext& gl)
: fCount(0)
, fCurrLRUStamp(0)
- , fGL(gl)
+ , fGL(gl)
#ifdef PROGRAM_CACHE_STATS
, fTotalRequests(0)
, fCacheMisses(0)