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

Side by Side Diff: src/core/SkCanvas.cpp

Issue 1734043002: Revert of Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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 | « site/user/api/canvas.md ('k') | src/core/SkImageCacherator.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 2008 The Android Open Source Project 2 * Copyright 2008 The Android Open Source Project
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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCanvasPriv.h" 10 #include "SkCanvasPriv.h"
(...skipping 1128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1139 SkBitmap srcBM; 1139 SkBitmap srcBM;
1140 1140
1141 #if SK_SUPPORT_GPU 1141 #if SK_SUPPORT_GPU
1142 GrRenderTarget* srcRT = src->accessRenderTarget(); 1142 GrRenderTarget* srcRT = src->accessRenderTarget();
1143 if (srcRT && !srcRT->asTexture() && dst->accessRenderTarget()) { 1143 if (srcRT && !srcRT->asTexture() && dst->accessRenderTarget()) {
1144 // When both the src & the dst are on the gpu but the src doesn't have a texture, 1144 // When both the src & the dst are on the gpu but the src doesn't have a texture,
1145 // we create a temporary texture for the draw. 1145 // we create a temporary texture for the draw.
1146 // TODO: we should actually only copy the portion of the source needed t o apply the image 1146 // TODO: we should actually only copy the portion of the source needed t o apply the image
1147 // filter 1147 // filter
1148 GrContext* context = srcRT->getContext(); 1148 GrContext* context = srcRT->getContext();
1149 SkAutoTUnref<GrTexture> tex(context->textureProvider()->createTexture(sr cRT->desc(), 1149 SkAutoTUnref<GrTexture> tex(context->textureProvider()->createTexture(sr cRT->desc(), true));
1150 Sk Budgeted::kYes));
1151 1150
1152 context->copySurface(tex, srcRT); 1151 context->copySurface(tex, srcRT);
1153 1152
1154 GrWrapTextureInBitmap(tex, src->width(), src->height(), src->isOpaque(), &srcBM); 1153 GrWrapTextureInBitmap(tex, src->width(), src->height(), src->isOpaque(), &srcBM);
1155 } else 1154 } else
1156 #endif 1155 #endif
1157 { 1156 {
1158 srcBM = src->accessBitmap(false); 1157 srcBM = src->accessBitmap(false);
1159 } 1158 }
1160 1159
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after
3001 } 3000 }
3002 3001
3003 if (matrix) { 3002 if (matrix) {
3004 canvas->concat(*matrix); 3003 canvas->concat(*matrix);
3005 } 3004 }
3006 } 3005 }
3007 3006
3008 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3007 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3009 fCanvas->restoreToCount(fSaveCount); 3008 fCanvas->restoreToCount(fSaveCount);
3010 } 3009 }
OLDNEW
« no previous file with comments | « site/user/api/canvas.md ('k') | src/core/SkImageCacherator.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698