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

Side by Side Diff: src/gpu/GrTextureParamsAdjuster.cpp

Issue 2215323003: Start using RenderTargetProxy (omnibus) (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrRenderTargetOpList.cpp ('k') | src/gpu/GrTextureToYUVPlanes.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "GrTextureParamsAdjuster.h" 8 #include "GrTextureParamsAdjuster.h"
9 9
10 #include "GrCaps.h" 10 #include "GrCaps.h"
11 #include "GrColorSpaceXform.h" 11 #include "GrColorSpaceXform.h"
12 #include "GrContext.h" 12 #include "GrContext.h"
13 #include "GrRenderTargetContext.h" 13 #include "GrRenderTargetContext.h"
14 #include "GrGpu.h" 14 #include "GrGpu.h"
15 #include "GrGpuResourcePriv.h" 15 #include "GrGpuResourcePriv.h"
16 #include "GrResourceKey.h" 16 #include "GrResourceKey.h"
17 #include "GrTexture.h" 17 #include "GrTexture.h"
18 #include "GrTextureParams.h" 18 #include "GrTextureParams.h"
19 #include "GrTextureProvider.h" 19 #include "GrTextureProvider.h"
20 #include "GrTextureProxy.h"
20 #include "SkCanvas.h" 21 #include "SkCanvas.h"
21 #include "SkGr.h" 22 #include "SkGr.h"
22 #include "SkGrPriv.h" 23 #include "SkGrPriv.h"
23 #include "effects/GrBicubicEffect.h" 24 #include "effects/GrBicubicEffect.h"
24 #include "effects/GrSimpleTextureEffect.h" 25 #include "effects/GrSimpleTextureEffect.h"
25 #include "effects/GrTextureDomain.h" 26 #include "effects/GrTextureDomain.h"
26 27
27 typedef GrTextureProducer::CopyParams CopyParams; 28 typedef GrTextureProducer::CopyParams CopyParams;
28 29
29 ////////////////////////////////////////////////////////////////////////////// 30 //////////////////////////////////////////////////////////////////////////////
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 localRect.fLeft *= sx; 79 localRect.fLeft *= sx;
79 localRect.fTop *= sy; 80 localRect.fTop *= sy;
80 localRect.fRight *= sx; 81 localRect.fRight *= sx;
81 localRect.fBottom *= sy; 82 localRect.fBottom *= sy;
82 } else { 83 } else {
83 localRect = SkRect::MakeWH(1.f, 1.f); 84 localRect = SkRect::MakeWH(1.f, 1.f);
84 } 85 }
85 86
86 SkRect dstRect = SkRect::MakeIWH(copyParams.fWidth, copyParams.fHeight); 87 SkRect dstRect = SkRect::MakeIWH(copyParams.fWidth, copyParams.fHeight);
87 copyRTC->fillRectToRect(GrNoClip(), paint, SkMatrix::I(), dstRect, localRect ); 88 copyRTC->fillRectToRect(GrNoClip(), paint, SkMatrix::I(), dstRect, localRect );
88 return copyRTC->asTexture().release(); 89 sk_sp<GrTextureProxy> tp(copyRTC->asDeferredTexture());
90 return SkRef(tp->instantiate(context->textureProvider()));
89 } 91 }
90 92
91 GrTextureAdjuster::GrTextureAdjuster(GrTexture* original, SkAlphaType alphaType, 93 GrTextureAdjuster::GrTextureAdjuster(GrTexture* original, SkAlphaType alphaType,
92 const SkIRect& contentArea, uint32_t unique ID, 94 const SkIRect& contentArea, uint32_t unique ID,
93 SkColorSpace* cs) 95 SkColorSpace* cs)
94 : INHERITED(contentArea.width(), contentArea.height(), 96 : INHERITED(contentArea.width(), contentArea.height(),
95 GrPixelConfigIsAlphaOnly(original->config())) 97 GrPixelConfigIsAlphaOnly(original->config()))
96 , fOriginal(original) 98 , fOriginal(original)
97 , fAlphaType(alphaType) 99 , fAlphaType(alphaType)
98 , fColorSpace(cs) 100 , fColorSpace(cs)
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 } 513 }
512 514
513 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams , bool willBeMipped, 515 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams , bool willBeMipped,
514 SkSourceGammaTreatment gamma Treatment) { 516 SkSourceGammaTreatment gamma Treatment) {
515 sk_sp<GrTexture> original(this->refOriginalTexture(willBeMipped, gammaTreatm ent)); 517 sk_sp<GrTexture> original(this->refOriginalTexture(willBeMipped, gammaTreatm ent));
516 if (!original) { 518 if (!original) {
517 return nullptr; 519 return nullptr;
518 } 520 }
519 return copy_on_gpu(original.get(), nullptr, copyParams); 521 return copy_on_gpu(original.get(), nullptr, copyParams);
520 } 522 }
OLDNEW
« no previous file with comments | « src/gpu/GrRenderTargetOpList.cpp ('k') | src/gpu/GrTextureToYUVPlanes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698