Flutter Engine
The Flutter Engine
Functions
GrDrawingManager.cpp File Reference
#include "src/gpu/ganesh/GrDrawingManager.h"
#include <algorithm>
#include <memory>
#include "include/gpu/GrBackendSemaphore.h"
#include "include/gpu/GrDirectContext.h"
#include "include/gpu/GrRecordingContext.h"
#include "include/private/chromium/GrDeferredDisplayList.h"
#include "src/base/SkTInternalLList.h"
#include "src/gpu/ganesh/GrBufferTransferRenderTask.h"
#include "src/gpu/ganesh/GrBufferUpdateRenderTask.h"
#include "src/gpu/ganesh/GrClientMappedBufferManager.h"
#include "src/gpu/ganesh/GrCopyRenderTask.h"
#include "src/gpu/ganesh/GrDDLTask.h"
#include "src/gpu/ganesh/GrDeferredDisplayListPriv.h"
#include "src/gpu/ganesh/GrDirectContextPriv.h"
#include "src/gpu/ganesh/GrGpu.h"
#include "src/gpu/ganesh/GrMemoryPool.h"
#include "src/gpu/ganesh/GrNativeRect.h"
#include "src/gpu/ganesh/GrOnFlushResourceProvider.h"
#include "src/gpu/ganesh/GrOpFlushState.h"
#include "src/gpu/ganesh/GrRecordingContextPriv.h"
#include "src/gpu/ganesh/GrRenderTargetProxy.h"
#include "src/gpu/ganesh/GrRenderTask.h"
#include "src/gpu/ganesh/GrRenderTaskCluster.h"
#include "src/gpu/ganesh/GrResourceAllocator.h"
#include "src/gpu/ganesh/GrResourceProvider.h"
#include "src/gpu/ganesh/GrSurfaceProxyPriv.h"
#include "src/gpu/ganesh/GrTTopoSort.h"
#include "src/gpu/ganesh/GrTexture.h"
#include "src/gpu/ganesh/GrTextureProxy.h"
#include "src/gpu/ganesh/GrTextureProxyPriv.h"
#include "src/gpu/ganesh/GrTextureResolveRenderTask.h"
#include "src/gpu/ganesh/GrTracing.h"
#include "src/gpu/ganesh/GrTransferFromRenderTask.h"
#include "src/gpu/ganesh/GrWaitRenderTask.h"
#include "src/gpu/ganesh/GrWritePixelsRenderTask.h"
#include "src/gpu/ganesh/ops/OpsTask.h"
#include "src/gpu/ganesh/ops/SoftwarePathRenderer.h"
#include "src/gpu/ganesh/surface/SkSurface_Ganesh.h"
#include "src/text/gpu/SDFTControl.h"

Go to the source code of this file.

Functions

template<typename T >
static void reorder_array_by_llist (const SkTInternalLList< T > &llist, TArray< sk_sp< T > > *array)
 
static void resolve_and_mipmap (GrGpu *gpu, GrSurfaceProxy *proxy)
 

Function Documentation

◆ reorder_array_by_llist()

template<typename T >
static void reorder_array_by_llist ( const SkTInternalLList< T > &  llist,
TArray< sk_sp< T > > *  array 
)
static

Definition at line 363 of file GrDrawingManager.cpp.

363 {
364 int i = 0;
365 for (T* t : llist) {
366 // Release the pointer that used to live here so it doesn't get unreffed.
367 [[maybe_unused]] T* old = array->at(i).release();
368 array->at(i++).reset(t);
369 }
370 SkASSERT(i == array->size());
371}
#define SkASSERT(cond)
Definition: SkAssert.h:116
int size() const
Definition: SkTArray.h:421
#define T
Definition: precompiler.cc:65

◆ resolve_and_mipmap()

static void resolve_and_mipmap ( GrGpu gpu,
GrSurfaceProxy proxy 
)
static

Definition at line 466 of file GrDrawingManager.cpp.

466 {
467 if (!proxy->isInstantiated()) {
468 return;
469 }
470
471 // In the flushSurfaces case, we need to resolve MSAA immediately after flush. This is
472 // because clients expect the flushed surface's backing texture to be fully resolved
473 // upon return.
474 if (proxy->requiresManualMSAAResolve()) {
475 auto* rtProxy = proxy->asRenderTargetProxy();
476 SkASSERT(rtProxy);
477 if (rtProxy->isMSAADirty()) {
478 SkASSERT(rtProxy->peekRenderTarget());
479 gpu->resolveRenderTarget(rtProxy->peekRenderTarget(), rtProxy->msaaDirtyRect());
481 rtProxy->markMSAAResolved();
482 }
483 }
484 // If, after a flush, any of the proxies of interest have dirty mipmaps, regenerate them in
485 // case their backend textures are being stolen.
486 // (This special case is exercised by the ReimportImageTextureWithMipLevels test.)
487 // FIXME: It may be more ideal to plumb down a "we're going to steal the backends" flag.
488 if (auto* textureProxy = proxy->asTextureProxy()) {
489 if (textureProxy->mipmapsAreDirty()) {
490 SkASSERT(textureProxy->peekTexture());
491 gpu->regenerateMipMapLevels(textureProxy->peekTexture());
492 textureProxy->markMipmapsClean();
493 }
494 }
495}
bool submitToGpu(GrSyncCpu sync)
Definition: GrGpu.cpp:748
bool regenerateMipMapLevels(GrTexture *)
Definition: GrGpu.cpp:632
void resolveRenderTarget(GrRenderTarget *, const SkIRect &resolveRect)
Definition: GrGpu.cpp:659
virtual GrRenderTargetProxy * asRenderTargetProxy()
bool requiresManualMSAAResolve() const
virtual GrTextureProxy * asTextureProxy()
bool isInstantiated() const