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

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

Issue 1728093005: Move Budgeted enum out of SkSurface, use in GrTextureProvider (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add aliases for Chrome Created 4 years, 10 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(), true)); 1149 SkAutoTUnref<GrTexture> tex(context->textureProvider()->createTexture(sr cRT->desc(),
1150 Sk Budgeted::kYes));
1150 1151
1151 context->copySurface(tex, srcRT); 1152 context->copySurface(tex, srcRT);
1152 1153
1153 GrWrapTextureInBitmap(tex, src->width(), src->height(), src->isOpaque(), &srcBM); 1154 GrWrapTextureInBitmap(tex, src->width(), src->height(), src->isOpaque(), &srcBM);
1154 } else 1155 } else
1155 #endif 1156 #endif
1156 { 1157 {
1157 srcBM = src->accessBitmap(false); 1158 srcBM = src->accessBitmap(false);
1158 } 1159 }
1159 1160
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after
3000 } 3001 }
3001 3002
3002 if (matrix) { 3003 if (matrix) {
3003 canvas->concat(*matrix); 3004 canvas->concat(*matrix);
3004 } 3005 }
3005 } 3006 }
3006 3007
3007 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() { 3008 SkAutoCanvasMatrixPaint::~SkAutoCanvasMatrixPaint() {
3008 fCanvas->restoreToCount(fSaveCount); 3009 fCanvas->restoreToCount(fSaveCount);
3009 } 3010 }
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