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

Side by Side Diff: src/image/SkSurface_Gpu.cpp

Issue 1266883002: unify pixelref and image ID space, so we can share IDs when we share pixels (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 4 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/image/SkImage_Raster.cpp ('k') | tests/ImageTest.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 2012 Google Inc. 2 * Copyright 2012 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 "SkSurface_Gpu.h" 8 #include "SkSurface_Gpu.h"
9 9
10 #include "SkCanvas.h" 10 #include "SkCanvas.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 &this->props()); 76 &this->props());
77 } 77 }
78 78
79 SkImage* SkSurface_Gpu::onNewImageSnapshot(Budgeted budgeted) { 79 SkImage* SkSurface_Gpu::onNewImageSnapshot(Budgeted budgeted) {
80 const SkImageInfo info = fDevice->imageInfo(); 80 const SkImageInfo info = fDevice->imageInfo();
81 const int sampleCount = fDevice->accessRenderTarget()->numColorSamples(); 81 const int sampleCount = fDevice->accessRenderTarget()->numColorSamples();
82 SkImage* image = NULL; 82 SkImage* image = NULL;
83 GrTexture* tex = fDevice->accessRenderTarget()->asTexture(); 83 GrTexture* tex = fDevice->accessRenderTarget()->asTexture();
84 if (tex) { 84 if (tex) {
85 image = SkNEW_ARGS(SkImage_Gpu, 85 image = SkNEW_ARGS(SkImage_Gpu,
86 (info.width(), info.height(), info.alphaType(), 86 (info.width(), info.height(), kNeedNewImageUniqueID, info.alphaType(),
87 tex, sampleCount, budgeted)); 87 tex, sampleCount, budgeted));
88 } 88 }
89 if (image) { 89 if (image) {
90 as_IB(image)->initWithProps(this->props()); 90 as_IB(image)->initWithProps(this->props());
91 } 91 }
92 return image; 92 return image;
93 } 93 }
94 94
95 // Create a new render target and, if necessary, copy the contents of the old 95 // Create a new render target and, if necessary, copy the contents of the old
96 // render target into it. Note that this flushes the SkGpuDevice but 96 // render target into it. Note that this flushes the SkGpuDevice but
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 } 167 }
168 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props, 168 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props,
169 SkGpuDevice::kUninit_In itContents)); 169 SkGpuDevice::kUninit_In itContents));
170 if (!device) { 170 if (!device) {
171 return NULL; 171 return NULL;
172 } 172 }
173 return SkNEW_ARGS(SkSurface_Gpu, (device)); 173 return SkNEW_ARGS(SkSurface_Gpu, (device));
174 } 174 }
175 175
176 #endif 176 #endif
OLDNEW
« no previous file with comments | « src/image/SkImage_Raster.cpp ('k') | tests/ImageTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698