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

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: 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
Index: src/gpu/gl/GrGLRenderTarget.cpp
diff --git a/src/gpu/gl/GrGLRenderTarget.cpp b/src/gpu/gl/GrGLRenderTarget.cpp
index 27713b2dd26010adc187eb452adc4bd5a027620b..82a9afb9fc19b1627c48b2d5fdd26b371bf001e1 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(idDesc), stencil) {
this->init(desc, idDesc);
this->registerWithCacheWrapped();
}
@@ -31,10 +31,21 @@ 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(idDesc)) {
this->init(desc, idDesc);
}
+inline GrRenderTarget::Flags GrGLRenderTarget::ComputeFlags(const IDDesc& idDesc) {
+ Flags flags = Flags::kNone;
+ if (idDesc.fRTFBOID) {
+ flags |= Flags::kOffscreen;
+ }
+ if (idDesc.fIsMixedSampled) {
+ flags |= Flags::kMixedSampled;
+ }
+ return flags;
+}
+
void GrGLRenderTarget::init(const GrSurfaceDesc& desc, const IDDesc& idDesc) {
fRTFBOID = idDesc.fRTFBOID;
fTexFBOID = idDesc.fTexFBOID;

Powered by Google App Engine
This is Rietveld 408576698