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

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

Issue 691523002: Separate out GrSurfaceConfig's fields from other structs used to create GrGL* GrSurface subclasses (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix indent Created 6 years, 2 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/gl/GrGLTexture.h » ('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 bcf6d711e5073c364966793667472a6014175996..0e8bd05bc735b009b0b0b0599b0293a49a02e699 100644
--- a/src/gpu/gl/GrGLRenderTarget.cpp
+++ b/src/gpu/gl/GrGLRenderTarget.cpp
@@ -13,70 +13,43 @@
#define GL_CALL(X) GR_GL_CALL(GPUGL->glInterface(), X)
-void GrGLRenderTarget::init(const Desc& desc,
+void GrGLRenderTarget::init(const GrSurfaceDesc& desc,
+ const IDDesc& idDesc,
const GrGLIRect& viewport,
GrGLTexID* texID) {
- fRTFBOID = desc.fRTFBOID;
- fTexFBOID = desc.fTexFBOID;
- fMSColorRenderbufferID = desc.fMSColorRenderbufferID;
+ fRTFBOID = idDesc.fRTFBOID;
+ fTexFBOID = idDesc.fTexFBOID;
+ fMSColorRenderbufferID = idDesc.fMSColorRenderbufferID;
fViewport = viewport;
fTexIDObj.reset(SkSafeRef(texID));
this->registerWithCache();
}
-namespace {
-GrSurfaceDesc MakeDesc(GrSurfaceFlags flags,
- int width, int height,
- GrPixelConfig config, int sampleCnt,
- GrSurfaceOrigin origin) {
- GrSurfaceDesc temp;
- temp.fFlags = flags;
- temp.fWidth = width;
- temp.fHeight = height;
- temp.fConfig = config;
- temp.fSampleCnt = sampleCnt;
- temp.fOrigin = origin;
- return temp;
-}
-
-};
-
GrGLRenderTarget::GrGLRenderTarget(GrGpuGL* gpu,
- const Desc& desc,
+ const IDDesc& idDesc,
const GrGLIRect& viewport,
GrGLTexID* texID,
GrGLTexture* texture)
- : INHERITED(gpu,
- desc.fIsWrapped,
- texture,
- MakeDesc(kNone_GrSurfaceFlags,
- viewport.fWidth, viewport.fHeight,
- desc.fConfig, desc.fSampleCnt,
- desc.fOrigin)) {
+ : INHERITED(gpu, idDesc.fIsWrapped, texture, texture->desc()) {
SkASSERT(texID);
SkASSERT(texture);
// FBO 0 can't also be a texture, right?
- SkASSERT(0 != desc.fRTFBOID);
- SkASSERT(0 != desc.fTexFBOID);
+ SkASSERT(0 != idDesc.fRTFBOID);
+ SkASSERT(0 != idDesc.fTexFBOID);
// we assume this is true, TODO: get rid of viewport as a param.
SkASSERT(viewport.fWidth == texture->width());
SkASSERT(viewport.fHeight == texture->height());
- this->init(desc, viewport, texID);
+ this->init(texture->desc(), idDesc, viewport, texID);
}
GrGLRenderTarget::GrGLRenderTarget(GrGpuGL* gpu,
- const Desc& desc,
+ const GrSurfaceDesc& desc,
+ const IDDesc& idDesc,
const GrGLIRect& viewport)
- : INHERITED(gpu,
- desc.fIsWrapped,
- NULL,
- MakeDesc(kNone_GrSurfaceFlags,
- viewport.fWidth, viewport.fHeight,
- desc.fConfig, desc.fSampleCnt,
- desc.fOrigin)) {
- this->init(desc, viewport, NULL);
+ : INHERITED(gpu, idDesc.fIsWrapped, NULL, desc) {
+ this->init(desc, idDesc, viewport, NULL);
}
void GrGLRenderTarget::onRelease() {
« no previous file with comments | « src/gpu/gl/GrGLRenderTarget.h ('k') | src/gpu/gl/GrGLTexture.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698