bool _ppt::has_schemas(void) { TRACE_EVENT("+_ppt::has_schemas", TRACE_TYPE_VERBOSE); bool result = !_schema.empty(); TRACE_EVENT("-_ppt::has_schemas", TRACE_TYPE_VERBOSE); return result; }
bool _ppt::is_active(void) { TRACE_EVENT("+_ppt::is_active", TRACE_TYPE_VERBOSE); bool result = _active; TRACE_EVENT("-_ppt::is_active", TRACE_TYPE_VERBOSE); return result; }
bool _ppt::has_generic_action(void) { TRACE_EVENT("+_ppt::has_generic_action", TRACE_TYPE_VERBOSE); bool result = _generic_action != NULL; TRACE_EVENT("-_ppt::has_generic_action", TRACE_TYPE_VERBOSE); return result; }
bool _ppt::has_exeception_action(void) { TRACE_EVENT("+_ppt::has_exeception_action", TRACE_TYPE_VERBOSE); bool result = _exception_action != NULL; TRACE_EVENT("-_ppt::has_exeception_action", TRACE_TYPE_VERBOSE); return result; }
size_t _ppt::get_schema_count(void) { TRACE_EVENT("+_ppt::get_schema_count", TRACE_TYPE_VERBOSE); size_t result = _schema.size(); TRACE_EVENT("-_ppt::get_schema_count", TRACE_TYPE_VERBOSE); return result; }
_ppt::_ppt( const _ppt &other ) : _active(other._active), _argument_action(other._argument_action), _generic_action(other._generic_action), _exception_action(other._exception_action), _schema(other._schema) { TRACE_EVENT("+_ppt::_ppt", TRACE_TYPE_INFORMATION); TRACE_EVENT("-_ppt::_ppt", TRACE_TYPE_INFORMATION); }
void _ppt::stop(void) { TRACE_EVENT("+_ppt::stop", TRACE_TYPE_INFORMATION); if(!_active) { THROW_PPT_EXC(PPT_EXC_INVAL_STATE_CHANGE); } _active = false; TRACE_EVENT("-_ppt::stop", TRACE_TYPE_INFORMATION); }
void CCLayerTreeHost::updateLayers(LayerChromium* rootLayer, CCTextureUpdater& updater) { TRACE_EVENT("CCLayerTreeHost::updateLayers", this, 0); if (!rootLayer->renderSurface()) rootLayer->createRenderSurface(); rootLayer->renderSurface()->setContentRect(IntRect(IntPoint(0, 0), deviceViewportSize())); IntRect rootClipRect(IntPoint(), deviceViewportSize()); rootLayer->setClipRect(rootClipRect); LayerList updateList; updateList.append(rootLayer); RenderSurfaceChromium* rootRenderSurface = rootLayer->renderSurface(); rootRenderSurface->clearLayerList(); { TRACE_EVENT("CCLayerTreeHost::updateLayers::calcDrawEtc", this, 0); WebTransformationMatrix identityMatrix; WebTransformationMatrix deviceScaleTransform; deviceScaleTransform.scale(m_deviceScaleFactor); CCLayerTreeHostCommon::calculateDrawTransforms(rootLayer, rootLayer, deviceScaleTransform, identityMatrix, updateList, rootRenderSurface->layerList(), layerRendererCapabilities().maxTextureSize); FloatRect rootScissorRect(FloatPoint(0, 0), viewportSize()); CCLayerTreeHostCommon::calculateVisibleAndScissorRects(updateList, rootScissorRect); } // Reset partial texture update requests. m_partialTextureUpdateRequests = 0; reserveTextures(updateList); paintLayerContents(updateList, PaintVisible, updater); if (!m_triggerIdlePaints) return; size_t preferredLimitBytes = m_contentsTextureManager->preferredMemoryLimitBytes(); size_t maxLimitBytes = m_contentsTextureManager->maxMemoryLimitBytes(); m_contentsTextureManager->reduceMemoryToLimit(preferredLimitBytes); if (m_contentsTextureManager->currentMemoryUseBytes() >= preferredLimitBytes) return; // Idle painting should fail when we hit the preferred memory limit, // otherwise it will always push us towards the maximum limit. m_contentsTextureManager->setMaxMemoryLimitBytes(preferredLimitBytes); // The second (idle) paint will be a no-op in layers where painting already occured above. paintLayerContents(updateList, PaintIdle, updater); m_contentsTextureManager->setMaxMemoryLimitBytes(maxLimitBytes); for (size_t i = 0; i < updateList.size(); ++i) updateList[i]->clearRenderSurface(); }
void _ppt::clear(void) { TRACE_EVENT("+_ppt::clear", TRACE_TYPE_VERBOSE); _active = false; _argument_action = NULL; _exception_action = NULL; _generic_action = NULL; _schema.clear(); TRACE_EVENT("-_ppt::clear", TRACE_TYPE_VERBOSE); }
bool _ppt::_has_registered_schema( const sch &schema ) { TRACE_EVENT("+_ppt::_has_registered_schema", TRACE_TYPE_VERBOSE); bool result = _get_registered_schema(schema) != _schema.end(); TRACE_EVENT("-_ppt::_has_registered_schema", TRACE_TYPE_VERBOSE); return result; }
void CCThreadProxy::commitOnCCThread(CCCompletionEvent* completion) { ASSERT(isImplThread()); TRACE_EVENT("CCThreadProxy::commitOnCCThread", this, 0); m_layerTreeHostImpl->beginCommit(); { TRACE_EVENT("CCLayerTreeHost::commit", this, 0); m_layerTreeHost->commitTo(m_layerTreeHostImpl.get()); } completion->signal(); m_layerTreeHostImpl->commitComplete(); setNeedsRedrawOnCCThread(); }
void CCThreadProxy::beginFrameAndCommit(int sequenceNumber, double frameBeginTime, PassOwnPtr<CCScrollUpdateSet> scrollInfo) { TRACE_EVENT("CCThreadProxy::beginFrameAndCommit", this, 0); ASSERT(isMainThread()); if (!m_layerTreeHost) return; // Scroll deltas need to be applied even if the commit will be dropped. m_layerTreeHost->applyScrollDeltas(*scrollInfo.get()); // Drop beginFrameAndCommit calls that occur out of sequence. See createBeginFrameAndCommitTaskOnImplThread for // an explanation of how out-of-sequence beginFrameAndCommit tasks can occur. if (sequenceNumber < m_lastExecutedBeginFrameAndCommitSequenceNumber) { TRACE_EVENT("EarlyOut_StaleBeginFrameAndCommit", this, 0); return; } m_lastExecutedBeginFrameAndCommitSequenceNumber = sequenceNumber; // FIXME: recreate the context if it was requested by the impl thread { TRACE_EVENT("CCLayerTreeHost::animateAndLayout", this, 0); m_layerTreeHost->animateAndLayout(frameBeginTime); } ASSERT(m_lastExecutedBeginFrameAndCommitSequenceNumber == sequenceNumber); // Clear the commit flag after animateAndLayout here --- objects that only // layout when painted will trigger another setNeedsCommit inside // updateLayers. m_commitRequested = false; m_layerTreeHost->updateLayers(); { // Blocking call to CCThreadProxy::commitOnImplThread TRACE_EVENT("commit", this, 0); CCCompletionEvent completion; s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::commitOnImplThread, AllowCrossThreadAccess(&completion))); completion.wait(); } m_layerTreeHost->commitComplete(); if (m_redrawAfterCommit) setNeedsRedraw(); m_redrawAfterCommit = false; ASSERT(m_lastExecutedBeginFrameAndCommitSequenceNumber == sequenceNumber); }
int main(int argc, char *argv[]) { volatile uint64_t workcnt = 0; int nthreads; debug_printf("bomptest started.\n"); bench_init(); #if CONFIG_TRACE errval_t err = trace_control(TRACE_EVENT(TRACE_SUBSYS_ROUTE, TRACE_EVENT_ROUTE_BENCH_START, 0), TRACE_EVENT(TRACE_SUBSYS_ROUTE, TRACE_EVENT_ROUTE_BENCH_STOP, 0), 0); assert(err_is_ok(err)); #endif if(argc == 2) { nthreads = atoi(argv[1]); backend_span_domain(nthreads, STACK_SIZE); bomp_custom_init(NULL); omp_set_num_threads(nthreads); } else { assert(!"Specify number of threads"); } trace_event(TRACE_SUBSYS_ROUTE, TRACE_EVENT_ROUTE_BENCH_START, 0); uint64_t start = bench_tsc(); #pragma omp parallel while(rdtsc() < start + 805000000ULL) { workcnt++; } uint64_t end = bench_tsc(); trace_event(TRACE_SUBSYS_ROUTE, TRACE_EVENT_ROUTE_BENCH_STOP, 0); printf("done. time taken: %" PRIu64 " cycles.\n", end - start); #if CONFIG_TRACE char *buf = malloc(4096*4096); trace_dump(buf, 4096*4096, NULL); printf("%s\n", buf); #endif for(;;); return 0; }
void LayerTextureSubImage::uploadWithTexSubImage(const uint8_t* image, const IntRect& imageRect, const IntRect& sourceRect, const IntRect& destRect, GC3Denum format, GraphicsContext3D* context) { TRACE_EVENT("LayerTextureSubImage::uploadWithTexSubImage", this, 0); if (!m_subImage) m_subImage = adoptArrayPtr(new uint8_t[m_subImageSize.width() * m_subImageSize.height() * 4]); // Offset from image-rect to source-rect. IntPoint offset(sourceRect.x() - imageRect.x(), sourceRect.y() - imageRect.y()); const uint8_t* pixelSource; if (imageRect.width() == sourceRect.width() && !offset.x()) pixelSource = &image[4 * offset.y() * imageRect.width()]; else { // Strides not equal, so do a row-by-row memcpy from the // paint results into a temp buffer for uploading. for (int row = 0; row < destRect.height(); ++row) memcpy(&m_subImage[destRect.width() * 4 * row], &image[4 * (offset.x() + (offset.y() + row) * imageRect.width())], destRect.width() * 4); pixelSource = &m_subImage[0]; } context->texSubImage2D(GraphicsContext3D::TEXTURE_2D, 0, destRect.x(), destRect.y(), destRect.width(), destRect.height(), format, GraphicsContext3D::UNSIGNED_BYTE, pixelSource); }
bool CCThreadProxy::initializeLayerRenderer() { TRACE_EVENT("CCThreadProxy::initializeLayerRenderer", this, 0); RefPtr<GraphicsContext3D> context = m_layerTreeHost->createLayerTreeHostContext3D(); if (!context) return false; ASSERT(context->hasOneRef()); // Leak the context pointer so we can transfer ownership of it to the other side... GraphicsContext3D* contextPtr = context.release().leakRef(); ASSERT(contextPtr->hasOneRef()); // Make a blocking call to initializeLayerRendererOnImplThread. The results of that call // are pushed into the initializeSucceeded and capabilities local variables. CCCompletionEvent completion; bool initializeSucceeded = false; LayerRendererCapabilities capabilities; s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::initializeLayerRendererOnImplThread, AllowCrossThreadAccess(contextPtr), AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&initializeSucceeded), AllowCrossThreadAccess(&capabilities), AllowCrossThreadAccess(&m_compositorIdentifier))); completion.wait(); if (initializeSucceeded) m_layerRendererCapabilitiesMainThreadCopy = capabilities; return initializeSucceeded; }
bool CCThreadProxy::compositeAndReadback(void *pixels, const IntRect& rect) { TRACE_EVENT("CCThreadPRoxy::compositeAndReadback", this, 0); ASSERT(isMainThread()); ASSERT(m_layerTreeHost); // If a commit is pending, perform the commit first. if (m_commitRequested) { // This bit of code is uglier than it should be because returning // pointers via the CCThread task model is really messy. Effectively, we // are making a blocking call to createBeginFrameAndCommitTaskOnImplThread, // and trying to get the CCMainThread::Task it returns so we can run it. OwnPtr<CCMainThread::Task> beginFrameAndCommitTask; { CCMainThread::Task* taskPtr = 0; CCCompletionEvent completion; s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::obtainBeginFrameAndCommitTaskFromCCThread, AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&taskPtr))); completion.wait(); beginFrameAndCommitTask = adoptPtr(taskPtr); } beginFrameAndCommitTask->performTask(); } // Draw using the new tree and read back the results. bool success = false; CCCompletionEvent completion; s_ccThread->postTask(createCCThreadTask(this, &CCThreadProxy::drawLayersAndReadbackOnImplThread, AllowCrossThreadAccess(&completion), AllowCrossThreadAccess(&success), AllowCrossThreadAccess(pixels), rect)); completion.wait(); return success; }
static void paintSkBitmap(PlatformContextSkia* platformContext, const NativeImageSkia& bitmap, const SkIRect& srcRect, const SkRect& destRect, const SkXfermode::Mode& compOp) { #if PLATFORM(CHROMIUM) TRACE_EVENT("paintSkBitmap", platformContext, 0); #endif SkPaint paint; paint.setXfermodeMode(compOp); paint.setFilterBitmap(true); paint.setAlpha(platformContext->getNormalizedAlpha()); paint.setLooper(platformContext->getDrawLooper()); // only antialias if we're rotated or skewed paint.setAntiAlias(hasNon90rotation(platformContext)); SkCanvas* canvas = platformContext->canvas(); ResamplingMode resampling; if (platformContext->isAccelerated()) resampling = RESAMPLE_LINEAR; else resampling = platformContext->printing() ? RESAMPLE_NONE : computeResamplingMode(platformContext, bitmap, srcRect.width(), srcRect.height(), SkScalarToFloat(destRect.width()), SkScalarToFloat(destRect.height())); if (resampling == RESAMPLE_AWESOME) { drawResampledBitmap(*canvas, paint, bitmap, srcRect, destRect); } else { // No resampling necessary, we can just draw the bitmap. We want to // filter it if we decided to do linear interpolation above, or if there // is something interesting going on with the matrix (like a rotation). // Note: for serialization, we will want to subset the bitmap first so // we don't send extra pixels. canvas->drawBitmapRect(bitmap.bitmap(), &srcRect, destRect, &paint); } platformContext->didDrawRect(destRect, paint, &bitmap.bitmap()); }
void CCThreadProxy::setNeedsRedraw() { ASSERT(isMainThread()); TRACE_EVENT("CCThreadProxy::setNeedsRedraw", this, 0); CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::setFullRootLayerDamageOnImplThread)); CCProxy::implThread()->postTask(createCCThreadTask(this, &CCThreadProxy::setNeedsRedrawOnImplThread)); }
void CCThreadProxy::onSwapBuffersCompleteOnImplThread() { ASSERT(isImplThread()); TRACE_EVENT("CCThreadProxy::onSwapBuffersCompleteOnImplThread", this, 0); m_schedulerOnImplThread->didSwapBuffersComplete(); m_mainThreadProxy->postTask(createCCThreadTask(this, &CCThreadProxy::didCompleteSwapBuffers)); }
void CCThreadProxy::initializeImplOnCCThread(CCCompletionEvent* completion) { TRACE_EVENT("CCThreadProxy::initializeImplOnCCThread", this, 0); ASSERT(isImplThread()); m_layerTreeHostImpl = m_layerTreeHost->createLayerTreeHostImpl(); completion->signal(); }
void CCThreadProxy::setNeedsCommitAndRedrawOnCCThread() { TRACE_EVENT("CCThreadProxy::setNeedsCommitAndRedrawOnCCThread", this, 0); ASSERT(isImplThread()); ASSERT(m_layerTreeHostImpl); ASSERT_NOT_REACHED(); }
void CCThreadProxy::drawLayersOnCCThread() { TRACE_EVENT("CCThreadProxy::drawLayersOnCCThread", this, 0); ASSERT(isImplThread()); if (m_layerTreeHostImpl) m_layerTreeHostImpl->drawLayers(); }
const SkBitmap* PlatformContextSkia::bitmap() const { #if PLATFORM(CHROMIUM) TRACE_EVENT("PlatformContextSkia::bitmap", this, 0); #endif return &m_canvas->getDevice()->accessBitmap(false); }
void CCLayerTreeHostImpl::drawLayers() { TRACE_EVENT("CCLayerTreeHostImpl::drawLayers", this, 0); ASSERT(m_layerRenderer); if (!rootLayer()) return; CCRenderPassList passes; CCLayerList renderSurfaceLayerList; calculateRenderPasses(passes, renderSurfaceLayerList); optimizeRenderPasses(passes); m_layerRenderer->beginDrawingFrame(); for (size_t i = 0; i < passes.size(); ++i) m_layerRenderer->drawRenderPass(passes[i].get()); typedef CCLayerIterator<CCLayerImpl, Vector<CCLayerImpl*>, CCRenderSurface, CCLayerIteratorActions::BackToFront> CCLayerIteratorType; CCLayerIteratorType end = CCLayerIteratorType::end(&renderSurfaceLayerList); for (CCLayerIteratorType it = CCLayerIteratorType::begin(&renderSurfaceLayerList); it != end; ++it) { if (it.representsItself() && !it->visibleLayerRect().isEmpty()) it->didDraw(); } m_layerRenderer->finishDrawingFrame(); ++m_frameNumber; // The next frame should start by assuming nothing has changed, and changes are noted as they occur. rootLayer()->resetAllChangeTrackingForSubtree(); }
CCLayerTreeHostImpl::~CCLayerTreeHostImpl() { ASSERT(CCProxy::isImplThread()); TRACE_EVENT("CCLayerTreeHostImpl::~CCLayerTreeHostImpl()", this, 0); if (m_layerRenderer) m_layerRenderer->close(); }
void trace_mpi_callers(iotimer_t time, int offset, int type) { CONTEXT ctx; int rc = 0, actual_deep = 1; /* Leave if they aren't initialized (asked by user!) */ if (Trace_Caller[CALLER_MPI] == NULL) return; exc_capture_context (&ctx); /* Unwind de la pila*/ while (!rc && ctx.sc_pc && actual_deep <= Caller_Deepness[type]+offset) { #ifdef MPICALLER_DEBUG /* Tampoco tenemos backtrace_symbols. Solo printamos las direcciones. */ fprintf(stderr, "[%d] 0x%012lx\n", actual_deep, ctx.sc_pc); #endif if (actual_deep >= offset) if (Trace_MPI_Caller[actual_deep-offset]) TRACE_EVENT(time, MPI_CALLER_EVENT_TYPE(actual_deep-offset+1), (UINT64)ctx.sc_pc); rc = exc_virtual_unwind(0, &ctx); actual_deep ++; } }
void CCLayerTreeHost::initializeLayerRenderer() { TRACE_EVENT("CCLayerTreeHost::initializeLayerRenderer", this, 0); if (!m_proxy->initializeLayerRenderer()) { // Uh oh, better tell the client that we can't do anything with this context. m_client->didRecreateContext(false); return; } // Update m_settings based on capabilities that we got back from the renderer. m_settings.acceleratePainting = m_proxy->layerRendererCapabilities().usingAcceleratedPainting; // Update m_settings based on partial update capability. m_settings.maxPartialTextureUpdates = min(m_settings.maxPartialTextureUpdates, m_proxy->maxPartialTextureUpdates()); m_contentsTextureManager = TextureManager::create(0, 0, m_proxy->layerRendererCapabilities().maxTextureSize); // FIXME: This is the same as setContentsMemoryAllocationLimitBytes, but // we're in the middle of a commit here and don't want to force another. m_memoryAllocationBytes = TextureManager::highLimitBytes(deviceViewportSize()); m_memoryAllocationIsForDisplay = true; m_layerRendererInitialized = true; m_settings.defaultTileSize = IntSize(min(m_settings.defaultTileSize.width(), m_proxy->layerRendererCapabilities().maxTextureSize), min(m_settings.defaultTileSize.height(), m_proxy->layerRendererCapabilities().maxTextureSize)); m_settings.maxUntiledLayerSize = IntSize(min(m_settings.maxUntiledLayerSize.width(), m_proxy->layerRendererCapabilities().maxTextureSize), min(m_settings.maxUntiledLayerSize.height(), m_proxy->layerRendererCapabilities().maxTextureSize)); }
void LayerTextureSubImage::uploadWithMapTexSubImage(const uint8_t* image, const IntRect& imageRect, const IntRect& sourceRect, const IntRect& destRect, GC3Denum format, GraphicsContext3D* context) { TRACE_EVENT("LayerTextureSubImage::uploadWithMapTexSubImage", this, 0); // Offset from image-rect to source-rect. IntPoint offset(sourceRect.x() - imageRect.x(), sourceRect.y() - imageRect.y()); // Upload tile data via a mapped transfer buffer Extensions3DChromium* extensions = static_cast<Extensions3DChromium*>(context->getExtensions()); uint8_t* pixelDest = static_cast<uint8_t*>(extensions->mapTexSubImage2DCHROMIUM(GraphicsContext3D::TEXTURE_2D, 0, destRect.x(), destRect.y(), destRect.width(), destRect.height(), format, GraphicsContext3D::UNSIGNED_BYTE, Extensions3DChromium::WRITE_ONLY)); if (!pixelDest) { uploadWithTexSubImage(image, imageRect, sourceRect, destRect, format, context); return; } if (imageRect.width() == sourceRect.width() && !offset.x()) memcpy(pixelDest, &image[4 * offset.y() * imageRect.width()], imageRect.width() * destRect.height() * 4); else { // Strides not equal, so do a row-by-row memcpy from the // paint results into the pixelDest for (int row = 0; row < destRect.height(); ++row) memcpy(&pixelDest[destRect.width() * 4 * row], &image[4 * (offset.x() + (offset.y() + row) * imageRect.width())], destRect.width() * 4); } extensions->unmapTexSubImage2DCHROMIUM(pixelDest); }
void ScheduledAction::execute(V8Proxy* proxy) { ASSERT(proxy); v8::HandleScope handleScope; v8::Handle<v8::Context> v8Context = v8::Local<v8::Context>::New(m_context.get()); if (v8Context.IsEmpty()) return; // JS may not be enabled. #if PLATFORM(CHROMIUM) TRACE_EVENT("ScheduledAction::execute", this, 0); #endif v8::Context::Scope scope(v8Context); proxy->setTimerCallback(true); // FIXME: Need to implement timeouts for preempting a long-running script. if (!m_function.IsEmpty() && m_function->IsFunction()) { proxy->callFunction(v8::Persistent<v8::Function>::Cast(m_function), v8Context->Global(), m_argc, m_argv); Document::updateStyleForAllDocuments(); } else proxy->evaluate(m_code, 0); proxy->setTimerCallback(false); }
void CCThreadProxy::beginFrameAndCommitOnCCThread() { TRACE_EVENT("CCThreadProxy::beginFrameAndCommitOnCCThread", this, 0); ASSERT(isImplThread()); ASSERT_NOT_REACHED(); // FIXME: call beginFrameAndCommit on main thread }