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

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

Issue 1918003003: Bring sk_sp to GrDrawContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: update Created 4 years, 7 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
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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 if (subset) { 105 if (subset) {
106 localRect = SkRect::Make(*subset); 106 localRect = SkRect::Make(*subset);
107 localRect.fLeft *= sx; 107 localRect.fLeft *= sx;
108 localRect.fTop *= sy; 108 localRect.fTop *= sy;
109 localRect.fRight *= sx; 109 localRect.fRight *= sx;
110 localRect.fBottom *= sy; 110 localRect.fBottom *= sy;
111 } else { 111 } else {
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 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(copy->asRend erTarget())));
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.release(); 122 return copy.release();
123 } 123 }
124 124
125 GrTextureAdjuster::GrTextureAdjuster(GrTexture* original, 125 GrTextureAdjuster::GrTextureAdjuster(GrTexture* original,
(...skipping 380 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

Powered by Google App Engine
This is Rietveld 408576698