Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: src/gpu/gl/GrGLRenderTarget.cpp

Issue 2225303002: Add flag for window rectangles to GrRenderTarget (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Add GrRenderTarget flag for window rectangles Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/gpu/gl/GrGLRenderTarget.h ('k') | src/gpu/vk/GrVkRenderTarget.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/gl/GrGLRenderTarget.cpp
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp
index 27713b2dd26010adc187eb452adc4bd5a027620b..8dacf48ce55d662ab6f86f2db4949f0e00bd8d7a 100644
--- a/src/gpu/gl/GrGLRenderTarget.cpp
+++ b/src/gpu/gl/GrGLRenderTarget.cpp
@@ -23,7 +23,7 @@ GrGLRenderTarget::GrGLRenderTarget(GrGLGpu* gpu,
const IDDesc& idDesc,
GrGLStencilAttachment* stencil)
: GrSurface(gpu, desc)
- , INHERITED(gpu, desc, idDesc.fSampleConfig, stencil) {
+ , INHERITED(gpu, desc, ComputeFlags(gpu->glCaps(), idDesc), stencil) {
this->init(desc, idDesc);
this->registerWithCacheWrapped();
}
@@ -31,10 +31,23 @@ GrGLRenderTarget::GrGLRenderTarget(GrGLGpu* gpu,
GrGLRenderTarget::GrGLRenderTarget(GrGLGpu* gpu, const GrSurfaceDesc& desc,
const IDDesc& idDesc)
: GrSurface(gpu, desc)
- , INHERITED(gpu, desc, idDesc.fSampleConfig) {
+ , INHERITED(gpu, desc, ComputeFlags(gpu->glCaps(), idDesc)) {
this->init(desc, idDesc);
}
+inline GrRenderTarget::Flags GrGLRenderTarget::ComputeFlags(const GrGLCaps& glCaps,
+ const IDDesc& idDesc) {
+ Flags flags = Flags::kNone;
+ if (idDesc.fIsMixedSampled) {
+ SkASSERT(glCaps.usesMixedSamples() && idDesc.fRTFBOID); // FBO 0 can't be mixed sampled.
+ flags |= Flags::kMixedSampled;
+ }
+ if (glCaps.maxWindowRectangles() > 0 && idDesc.fRTFBOID) {
+ flags |= Flags::kWindowRectsSupport;
+ }
+ return flags;
+}
+
void GrGLRenderTarget::init(const GrSurfaceDesc& desc, const IDDesc& idDesc) {
fRTFBOID = idDesc.fRTFBOID;
fTexFBOID = idDesc.fTexFBOID;
« no previous file with comments | « src/gpu/gl/GrGLRenderTarget.h ('k') | src/gpu/vk/GrVkRenderTarget.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698