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

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

Issue 1809733002: detach -> release (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: (C) Created 4 years, 9 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 unified diff | Download patch
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrYUVProvider.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"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 localRect = SkRect::MakeWH(1.f, 1.f); 112 localRect = SkRect::MakeWH(1.f, 1.f);
113 } 113 }
114 114
115 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(copy->asRenderT arget())); 115 SkAutoTUnref<GrDrawContext> drawContext(context->drawContext(copy->asRenderT arget()));
116 if (!drawContext) { 116 if (!drawContext) {
117 return nullptr; 117 return nullptr;
118 } 118 }
119 119
120 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar( rtDesc.fHeight)); 120 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar( rtDesc.fHeight));
121 drawContext->fillRectToRect(GrClip::WideOpen(), paint, SkMatrix::I(), dstRec t, localRect); 121 drawContext->fillRectToRect(GrClip::WideOpen(), paint, SkMatrix::I(), dstRec t, localRect);
122 return copy.detach(); 122 return copy.release();
123 } 123 }
124 124
125 GrTextureAdjuster::GrTextureAdjuster(GrTexture* original, 125 GrTextureAdjuster::GrTextureAdjuster(GrTexture* original,
126 const SkIRect& contentArea, 126 const SkIRect& contentArea,
127 bool isAlphaOnly) 127 bool isAlphaOnly)
128 : INHERITED(contentArea.width(), contentArea.height(), isAlphaOnly) 128 : INHERITED(contentArea.width(), contentArea.height(), isAlphaOnly)
129 , fOriginal(original) { 129 , fOriginal(original) {
130 SkASSERT(SkIRect::MakeWH(original->width(), original->height()).contains(con tentArea)); 130 SkASSERT(SkIRect::MakeWH(original->width(), original->height()).contains(con tentArea));
131 if (contentArea.fLeft > 0 || contentArea.fTop > 0 || 131 if (contentArea.fLeft > 0 || contentArea.fTop > 0 ||
132 contentArea.fRight < original->width() || contentArea.fBottom < original ->height()) { 132 contentArea.fRight < original->width() || contentArea.fBottom < original ->height()) {
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after
506 } 506 }
507 507
508 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams , 508 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams ,
509 bool willBeMipped) { 509 bool willBeMipped) {
510 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped)); 510 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped));
511 if (!original) { 511 if (!original) {
512 return nullptr; 512 return nullptr;
513 } 513 }
514 return copy_on_gpu(original, nullptr, copyParams); 514 return copy_on_gpu(original, nullptr, copyParams);
515 } 515 }
OLDNEW
« no previous file with comments | « src/gpu/GrGpu.cpp ('k') | src/gpu/GrYUVProvider.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698