Home | History | Annotate | Download | only in gpu

Lines Matching defs:Plot

58 GrDrawOpAtlas::Plot::Plot(int pageIndex, int plotIndex, uint64_t genID, int offX, int offY,
87 GrDrawOpAtlas::Plot::~Plot() {
92 bool GrDrawOpAtlas::Plot::addSubImage(int width, int height, const void* image, SkIPoint16* loc) {
137 void GrDrawOpAtlas::Plot::uploadToTexture(GrDeferredTextureUploadWritePixelsFn& writePixels,
161 void GrDrawOpAtlas::Plot::resetRects() {
171 // zero out the plot
213 inline bool GrDrawOpAtlas::updatePlot(GrDeferredUploadTarget* target, AtlasID* id, Plot* plot) {
214 int pageIdx = GetPageIndexFromID(plot->id());
215 this->makeMRU(plot, pageIdx);
220 if (plot->lastUploadToken() < target->tokenTracker()->nextTokenToFlush()) {
222 sk_sp<Plot> plotsp(SkRef(plot));
231 plot->setLastUploadToken(lastUploadToken);
233 *id = plot->id();
245 for (Plot* plot = plotIter.get(); plot; plot = plotIter.next()) {
246 SkASSERT(GrBytesPerPixel(fProxies[pageIdx]->config()) == plot->bpp());
248 if (plot->addSubImage(width, height, image, loc)) {
249 return this->updatePlot(target, id, plot);
256 // Number of atlas-related flushes beyond which we consider a plot to no longer be in use.
281 // If the above fails, then see if the least recently used plot per page has already been
282 // flushed to the gpu if we're at max page allocation, or if the plot has aged out otherwise.
288 Plot* plot = fPages[pageIdx].fPlotList.tail();
289 SkASSERT(plot);
290 if (plot->lastUseToken() < target->tokenTracker()->nextTokenToFlush()) {
291 this->processEvictionAndResetRects(plot);
292 SkASSERT(GrBytesPerPixel(fProxies[pageIdx]->config()) == plot->bpp());
293 SkDEBUGCODE(bool verify = )plot->addSubImage(width, height, image, loc);
295 if (!this->updatePlot(target, id, plot)) {
320 // Try to find a plot that we can perform an inline upload to.
322 Plot* plot = nullptr;
324 Plot* currentPlot = fPages[pageIdx].fPlotList.tail();
326 plot = currentPlot;
331 // If we can't find a plot that is not used in a draw currently being prepared by an op, then
335 // draw which references the plot's pre-upload content.
336 if (!plot) {
340 this->processEviction(plot->id());
341 int pageIdx = GetPageIndexFromID(plot->id());
342 fPages[pageIdx].fPlotList.remove(plot);
343 sk_sp<Plot>& newPlot = fPages[pageIdx].fPlotArray[plot->index()];
344 newPlot.reset(plot->clone());
351 // Note that this plot will be uploaded inline with the draws whereas the
354 sk_sp<Plot> plotsp(SkRef(newPlot.get()));
381 while (Plot* plot = plotIter.get()) {
383 if (plot->lastUseToken().inInterval(fPrevFlushToken, startTokenForNextFlush)) {
384 plot->resetFlushesSinceLastUsed();
397 SkTArray<Plot*> availablePlots;
409 while (Plot* plot = plotIter.get()) {
410 // Update number of flushes since plot was last used
414 if (!plot->lastUseToken().inInterval(fPrevFlushToken, startTokenForNextFlush)) {
415 plot->incFlushesSinceLastUsed();
420 SkDebugf("%d ", plot->flushesSinceLastUsed());
425 if (plot->flushesSinceLastUsed() > kRecentlyUsedCount) {
426 availablePlots.push_back() = plot;
448 while (Plot* plot = plotIter.get()) {
449 // Update number of flushes since plot was last used
450 if (!plot->lastUseToken().inInterval(fPrevFlushToken, startTokenForNextFlush)) {
451 plot->incFlushesSinceLastUsed();
456 SkDebugf("%d ", plot->flushesSinceLastUsed());
459 // If this plot was used recently
460 if (plot->flushesSinceLastUsed() <= kRecentlyUsedCount) {
462 } else if (plot->lastUseToken() != GrDeferredUploadToken::AlreadyFlushedToken()) {
464 this->processEvictionAndResetRects(plot);
480 while (Plot* plot = plotIter.get()) {
481 // If this plot was used recently
482 if (plot->flushesSinceLastUsed() <= kRecentlyUsedCount) {
487 this->processEvictionAndResetRects(plot);
534 fPages[i].fPlotArray.reset(new sk_sp<Plot>[ numPlotsX * numPlotsY ]);
536 sk_sp<Plot>* currPlot = fPages[i].fPlotArray.get();
540 currPlot->reset(new Plot(i, plotIndex, 1, x, y, fPlotWidth, fPlotHeight,
586 Plot* currPlot = fPages[lastPageIndex].fPlotArray[plotIndex].get();
641 // allows us to pack 3 in a 512x256 plot, or 9 in a 512x512 plot.