limitations under the License.
*/
+#include "GrBufferAllocPool.h"
+#include "GrClipIterator.h"
#include "GrContext.h"
#include "GrGpu.h"
-#include "GrTextureCache.h"
-#include "GrTextStrike.h"
-#include "GrMemory.h"
-#include "GrClipIterator.h"
#include "GrIndexBuffer.h"
#include "GrInOrderDrawBuffer.h"
-#include "GrBufferAllocPool.h"
+#include "GrMemory.h"
#include "GrPathRenderer.h"
#include "GrPathUtils.h"
+#include "GrTextureCache.h"
+#include "GrTextStrike.h"
+#include SK_USER_TRACE_INCLUDE_FILE
// Using MSAA seems to be slower for some yet unknown reason.
#define PREFER_MSAA_OFFSCREEN_AA 0
const GrSamplerState& sampler,
const GrTextureDesc& desc,
void* srcData, size_t rowBytes) {
+ SK_TRACE_EVENT0("GrContext::createAndLockTexture");
GrAssert(key->width() == desc.fWidth);
GrAssert(key->height() == desc.fHeight);
const GrIRect& boundRect,
int tileX, int tileY,
OffscreenRecord* record) {
-
+ SK_TRACE_EVENT0("GrContext::doOffscreenAAPass2");
GrAssert(NULL != record->fEntry0);
GrIRect tileRect;
void GrContext::fillAARect(GrDrawTarget* target,
const GrPaint& paint,
const GrRect& devRect) {
-
GrVertexLayout layout = PaintStageVertexLayoutBits(paint, NULL) |
GrDrawTarget::kColor_VertexLayoutBit;
const GrRect& rect,
GrScalar width,
const GrMatrix* matrix) {
-
+ SK_TRACE_EVENT0("GrContext::drawRect");
GrDrawTarget* target = this->prepareToDraw(paint, kUnbuffered_DrawCategory);
int stageMask = paint.getActiveStageMask();
const GrRect& srcRect,
const GrMatrix* dstMatrix,
const GrMatrix* srcMatrix) {
+ SK_TRACE_EVENT0("GrContext::drawRectToRect");
// srcRect refers to paint's first texture
if (NULL == paint.getTexture(0)) {
const GrColor colors[],
const uint16_t indices[],
int indexCount) {
+ SK_TRACE_EVENT0("GrContext::drawVertices");
GrDrawTarget::AutoReleaseGeometry geo;
bool GrContext::readTexturePixels(GrTexture* texture,
int left, int top, int width, int height,
GrPixelConfig config, void* buffer) {
+ SK_TRACE_EVENT0("GrContext::readTexturePixels");
// TODO: code read pixels for textures that aren't rendertargets
bool GrContext::readRenderTargetPixels(GrRenderTarget* target,
int left, int top, int width, int height,
GrPixelConfig config, void* buffer) {
+ SK_TRACE_EVENT0("GrContext::readRenderTargetPixels");
uint32_t flushFlags = 0;
if (NULL == target) {
flushFlags |= GrContext::kForceCurrentRenderTarget_FlushBit;
void GrContext::writePixels(int left, int top, int width, int height,
GrPixelConfig config, const void* buffer,
size_t stride) {
+ SK_TRACE_EVENT0("GrContext::writePixels");
// TODO: when underlying api has a direct way to do this we should use it
// (e.g. glDrawPixels on desktop GL).
#include "GrMemory.h"
#include "SkXfermode.h"
+#include SK_USER_TRACE_INCLUDE_FILE
namespace {
int stringCnt,
const char** strings,
int* stringLengths) {
+ SK_TRACE_EVENT1("GrGLProgram::CompileShader",
+ "stringCount", SkStringPrintf("%i", stringCnt).c_str());
+
GrGLuint shader = GR_GL(CreateShader(type));
if (0 == shader) {
return 0;
#include "GrMemory.h"
#include "GrTexture.h"
+#include "SkString.h"
+#include SK_USER_TRACE_INCLUDE_FILE
+
GrPathRenderer::GrPathRenderer()
: fCurveTolerance (GR_Scalar1) {
GrPathFill fill,
const GrPoint* translate,
bool stencilOnly) {
+ SK_TRACE_EVENT1("GrDefaultPathRenderer::onDrawPath",
+ "points", SkStringPrintf("%i", path.countPoints()).c_str());
GrDrawTarget::AutoStateRestore asr(target);
bool colorWritesWereDisabled = target->isColorWriteDisabled();
SkPath::Iter iter(path, false);
+ {
+ SK_TRACE_EVENT0("GrDefaultPathRenderer::onDrawPath::assembleVerts");
for (;;) {
+
GrPathCmd cmd = (GrPathCmd)iter.next(pts);
switch (cmd) {
case kMove_PathCmd:
}
first = false;
}
+ }
FINISHED:
GrAssert(subpath == subpathCnt);
GrAssert((vert - base) <= maxPts);
bounds.fBottom);
}
+ {
+ SK_TRACE_EVENT1("GrDefaultPathRenderer::onDrawPath::renderPasses",
+ "verts", SkStringPrintf("%i", vert - base).c_str());
for (int p = 0; p < passCount; ++p) {
target->setDrawFace(drawFace[p]);
if (NULL != passes[p]) {
}
}
}
+ }
}
void GrDefaultPathRenderer::drawPath(GrDrawTarget* target,
'../src/core/SkTypefaceCache.cpp',
'../src/core/SkTypefaceCache.h',
'../src/core/SkUnPreMultiply.cpp',
+ '../src/core/SkUserTrace.h',
'../src/core/SkUtils.cpp',
'../src/core/SkWriter32.cpp',
'../src/core/SkXfermode.cpp',
'../include/core/SkThread.h',
'../include/core/SkThread_platform.h',
'../include/core/SkTime.h',
+ '../include/core/SkTrace.h',
'../include/core/SkTypeface.h',
'../include/core/SkTypes.h',
'../include/core/SkUnPreMultiply.h',
//#define SK_SUPPORT_UNITTEST
#endif
+/* If your system embeds skia and has complex event logging, redefine this
+ symbol to point to a file that maps the following macros to your system's
+ equivalents:
+ SK_TRACE_EVENT0(event)
+ SK_TRACE_EVENT1(event, name1, value1)
+ SK_TRACE_EVENT2(event, name1, value1, name2, value2)
+ include/config/SkUserTrace.h has a no-op implementation, while
+ src/utils/SkDebugTrace.h has a trivial implementation that writes to
+ the debug output stream.
+*/
+#define SK_USER_TRACE_INCLUDE_FILE "../../include/config/SkUserTrace.h"
+
/* Change the ordering to work in X windows.
*/
#ifdef SK_SAMPLES_FOR_X
--- /dev/null
+/*
+ Copyright 2010 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+#ifndef SkUserTrace_DEFINED
+#define SkUserTrace_DEFINED
+
+/* If your system embeds skia and has complex event logging, define these
+ to map to your system's equivalents. A trivial example is given in
+ src/utils/SkDebugTrace.h.
+
+ All arguments are const char*. Skia typically passes the name of
+ the object and function (and sometimes region of interest within
+ the function) separated by double colons for 'event'.
+
+ SK_TRACE_EVENT1 and SK_TRACE_EVENT2 take one or two arbitrary
+ name-value pairs that you also want to log. SkStringPrintf() is useful
+ for formatting these values.
+
+ For example:
+ SK_TRACE_EVENT0("GrContext::createAndLockTexture");
+ SK_TRACE_EVENT1("GrDefaultPathRenderer::onDrawPath::renderPasses",
+ "verts", SkStringPrintf("%i", vert - base).c_str());
+*/
+#define SK_TRACE_EVENT0(event)
+#define SK_TRACE_EVENT1(event, name1, value1)
+#define SK_TRACE_EVENT2(event, name1, value1, name2, value2)
+
+#endif
+
+
--- /dev/null
+/*
+ Copyright 2011 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+ */
+#ifndef SkUserTrace_DEFINED
+#define SkUserTrace_DEFINED
+
+/* Sample implementation of SkUserTrace that routes all of the
+ trace macros to debug output stream.
+ To use this, redefine SK_USER_TRACE_INCLUDE_FILE in
+ include/config/SkUserConfig.h to point to this file
+*/
+#define SK_TRACE_EVENT0(event) \
+ SkDebugf("Trace: %s\n", event)
+#define SK_TRACE_EVENT1(event, name1, value1) \
+ SkDebugf("Trace: %s (%s=%s)\n", event, name1, value1)
+#define SK_TRACE_EVENT2(event, name1, value1, name2, value2) \
+ SkDebugf("Trace: %s (%s=%s, %s=%s)\n", event, name1, value1, name2, value2)
+
+#endif
+
+