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

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

Issue 1208993008: explicitly bump legacy genID on gpu surface (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add dox Created 5 years, 5 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 | « no previous file | tests/SurfaceTest.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 17 matching lines...) Expand all
28 28
29 GrBackendObject SkSurface_Gpu::onGetTextureHandle(TextureHandleAccess access) { 29 GrBackendObject SkSurface_Gpu::onGetTextureHandle(TextureHandleAccess access) {
30 GrRenderTarget* rt = fDevice->accessRenderTarget(); 30 GrRenderTarget* rt = fDevice->accessRenderTarget();
31 switch (access) { 31 switch (access) {
32 case kFlushRead_TextureHandleAccess: 32 case kFlushRead_TextureHandleAccess:
33 break; 33 break;
34 case kFlushWrite_TextureHandleAccess: 34 case kFlushWrite_TextureHandleAccess:
35 case kDiscardWrite_TextureHandleAccess: 35 case kDiscardWrite_TextureHandleAccess:
36 // for now we don't special-case on Discard, but we may in the futur e. 36 // for now we don't special-case on Discard, but we may in the futur e.
37 this->notifyContentWillChange(kRetain_ContentChangeMode); 37 this->notifyContentWillChange(kRetain_ContentChangeMode);
38 // legacy: need to dirty the bitmap's genID in our device (curse it)
39 fDevice->fLegacyBitmap.notifyPixelsChanged();
38 break; 40 break;
39 } 41 }
40 rt->prepareForExternalIO(); 42 rt->prepareForExternalIO();
41 return rt->asTexture()->getTextureHandle(); 43 return rt->asTexture()->getTextureHandle();
42 } 44 }
43 45
44 SkCanvas* SkSurface_Gpu::onNewCanvas() { 46 SkCanvas* SkSurface_Gpu::onNewCanvas() {
45 SkCanvas::InitFlags flags = SkCanvas::kDefault_InitFlags; 47 SkCanvas::InitFlags flags = SkCanvas::kDefault_InitFlags;
46 // When we think this works... 48 // When we think this works...
47 // flags |= SkCanvas::kConservativeRasterClip_InitFlag; 49 // flags |= SkCanvas::kConservativeRasterClip_InitFlag;
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 } 151 }
150 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props, 152 SkAutoTUnref<SkGpuDevice> device(SkGpuDevice::Create(rt, props,
151 SkGpuDevice::kUninit_In itContents)); 153 SkGpuDevice::kUninit_In itContents));
152 if (!device) { 154 if (!device) {
153 return NULL; 155 return NULL;
154 } 156 }
155 return SkNEW_ARGS(SkSurface_Gpu, (device)); 157 return SkNEW_ARGS(SkSurface_Gpu, (device));
156 } 158 }
157 159
158 #endif 160 #endif
OLDNEW
« no previous file with comments | « no previous file | tests/SurfaceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698