Home | History | Annotate | Download | only in gpu

Lines Matching defs:Plot

39 GrDrawOpAtlas::Plot::Plot(int pageIndex, int plotIndex, uint64_t genID, int offX, int offY,
64 GrDrawOpAtlas::Plot::~Plot() {
69 bool GrDrawOpAtlas::Plot::addSubImage(int width, int height, const void* image, SkIPoint16* loc) {
114 void GrDrawOpAtlas::Plot::uploadToTexture(GrDeferredTextureUploadWritePixelsFn& writePixels,
129 void GrDrawOpAtlas::Plot::resetRects() {
139 // zero out the plot
178 inline bool GrDrawOpAtlas::updatePlot(GrDeferredUploadTarget* target, AtlasID* id, Plot* plot) {
179 int pageIdx = GetPageIndexFromID(plot->id());
180 this->makeMRU(plot, pageIdx);
185 if (plot->lastUploadToken() < target->tokenTracker()->nextTokenToFlush()) {
187 sk_sp<Plot> plotsp(SkRef(plot));
201 plot->setLastUploadToken(lastUploadToken);
203 *id = plot->id();
207 // Number of atlas-related flushes beyond which we consider a plot to no longer be in use.
229 Plot* plot;
230 while ((plot = plotIter.get())) {
231 SkASSERT(GrBytesPerPixel(fProxies[pageIdx]->config()) == plot->bpp());
232 if (plot->addSubImage(width, height, image, loc)) {
233 return this->updatePlot(target, id, plot);
239 // If the above fails, then see if the least recently used plot per page has already been
240 // flushed to the gpu if we're at max page allocation, or if the plot has aged out otherwise.
245 Plot* plot = fPages[pageIdx].fPlotList.tail();
246 SkASSERT(plot);
248 plot->lastUseToken() < target->tokenTracker()->nextTokenToFlush()) ||
249 plot->flushesSinceLastUsed() >= kRecentlyUsedCount) {
250 this->processEvictionAndResetRects(plot);
251 SkASSERT(GrBytesPerPixel(fProxies[pageIdx]->config()) == plot->bpp());
252 SkDEBUGCODE(bool verify = )plot->addSubImage(width, height, image, loc);
254 if (!this->updatePlot(target, id, plot)) {
265 Plot* plot = fPages[pageIdx].fPlotList.head();
266 SkASSERT(GrBytesPerPixel(fProxies[pageIdx]->config()) == plot->bpp());
267 if (plot->addSubImage(width, height, image, loc)) {
268 return this->updatePlot(target, id, plot);
276 // Try to find a plot that we can perform an inline upload to.
278 Plot* plot = nullptr;
280 Plot* currentPlot = fPages[pageIdx].fPlotList.tail();
282 plot = currentPlot;
287 // If we can't find a plot that is not used in a draw currently being prepared by an op, then
291 //draw which references the plot's pre-upload content.
292 if (!plot) {
296 this->processEviction(plot->id());
297 int pageIdx = GetPageIndexFromID(plot->id());
298 fPages[pageIdx].fPlotList.remove(plot);
299 sk_sp<Plot>& newPlot = fPages[pageIdx].fPlotArray[plot->index()];
300 newPlot.reset(plot->clone());
307 // Note that this plot will be uploaded inline with the draws whereas the
310 sk_sp<Plot> plotsp(SkRef(newPlot.get()));
340 while (Plot* plot = plotIter.get()) {
342 if (plot->lastUseToken().inInterval(fPrevFlushToken, startTokenForNextFlush)) {
343 plot->resetFlushesSinceLastUsed();
368 while (Plot* plot = plotIter.get()) {
369 // Update number of flushes since plot was last used
373 if (!plot->lastUseToken().inInterval(fPrevFlushToken, startTokenForNextFlush)) {
374 plot->incFlushesSinceLastUsed();
379 SkDebugf("%d ", plot->flushesSinceLastUsed());
384 if (plot->flushesSinceLastUsed() > kRecentlyUsedCount) {
407 while (Plot* plot = plotIter.get()) {
408 // Update number of flushes since plot was last used
409 if (!plot->lastUseToken().inInterval(fPrevFlushToken, startTokenForNextFlush)) {
410 plot->incFlushesSinceLastUsed();
415 SkDebugf("%d ", plot->flushesSinceLastUsed());
418 // If this plot was used recently
419 if (plot->flushesSinceLastUsed() <= kRecentlyUsedCount) {
422 // We need to be somewhat harsh here so that one plot that is consistently in use
425 this->processEvictionAndResetRects(plot);
428 } else if (plot->lastUseToken() != GrDeferredUploadToken::AlreadyFlushedToken()) {
430 this->processEvictionAndResetRects(plot);
478 fPages[fNumPages].fPlotArray.reset(new sk_sp<Plot>[ numPlotsX * numPlotsY ]);
480 sk_sp<Plot>* currPlot = fPages[fNumPages].fPlotArray.get();
484 currPlot->reset(new Plot(fNumPages, plotIndex, 1, x, y, fPlotWidth, fPlotHeight,