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

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

Issue 1971343002: Convert GrClip to an abstract base class (Closed) Base URL: https://skia.googlesource.com/skia.git@upload2_clipout
Patch Set: fix crash 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
« no previous file with comments | « src/gpu/GrDrawTarget.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"
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 } else { 112 } else {
113 localRect = SkRect::MakeWH(1.f, 1.f); 113 localRect = SkRect::MakeWH(1.f, 1.f);
114 } 114 }
115 115
116 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(copy->asRend erTarget()))); 116 sk_sp<GrDrawContext> drawContext(context->drawContext(sk_ref_sp(copy->asRend erTarget())));
117 if (!drawContext) { 117 if (!drawContext) {
118 return nullptr; 118 return nullptr;
119 } 119 }
120 120
121 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar( rtDesc.fHeight)); 121 SkRect dstRect = SkRect::MakeWH(SkIntToScalar(rtDesc.fWidth), SkIntToScalar( rtDesc.fHeight));
122 drawContext->fillRectToRect(GrClip::WideOpen(), paint, SkMatrix::I(), dstRec t, localRect); 122 drawContext->fillRectToRect(GrNoClip(), paint, SkMatrix::I(), dstRect, local Rect);
123 return copy.release(); 123 return copy.release();
124 } 124 }
125 125
126 GrTextureAdjuster::GrTextureAdjuster(GrTexture* original, 126 GrTextureAdjuster::GrTextureAdjuster(GrTexture* original,
127 const SkIRect& contentArea, 127 const SkIRect& contentArea,
128 bool isAlphaOnly) 128 bool isAlphaOnly)
129 : INHERITED(contentArea.width(), contentArea.height(), isAlphaOnly) 129 : INHERITED(contentArea.width(), contentArea.height(), isAlphaOnly)
130 , fOriginal(original) { 130 , fOriginal(original) {
131 SkASSERT(SkIRect::MakeWH(original->width(), original->height()).contains(con tentArea)); 131 SkASSERT(SkIRect::MakeWH(original->width(), original->height()).contains(con tentArea));
132 if (contentArea.fLeft > 0 || contentArea.fTop > 0 || 132 if (contentArea.fLeft > 0 || contentArea.fTop > 0 ||
(...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 } 507 }
508 508
509 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams , 509 GrTexture* GrTextureMaker::generateTextureForParams(const CopyParams& copyParams ,
510 bool willBeMipped) { 510 bool willBeMipped) {
511 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped)); 511 SkAutoTUnref<GrTexture> original(this->refOriginalTexture(willBeMipped));
512 if (!original) { 512 if (!original) {
513 return nullptr; 513 return nullptr;
514 } 514 }
515 return copy_on_gpu(original, nullptr, copyParams); 515 return copy_on_gpu(original, nullptr, copyParams);
516 } 516 }
OLDNEW
« no previous file with comments | « src/gpu/GrDrawTarget.cpp ('k') | src/gpu/GrTextureToYUVPlanes.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698