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

Side by Side Diff: sky/engine/platform/graphics/skia/GaneshUtils.cpp

Issue 1236953002: Roll Skia to 7b971f0152299ae9a924252a9bfd220318497bdd (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: now with less crash on startup 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 | « sky/engine/platform/graphics/Path.cpp ('k') | sky/engine/platform/graphics/skia/SkiaUtils.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 (c) 2013, Google Inc. All rights reserved. 2 * Copyright (c) 2013, Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 24 matching lines...) Expand all
35 35
36 namespace blink { 36 namespace blink {
37 37
38 bool ensureTextureBackedSkBitmap(GrContext* gr, SkBitmap& bitmap, const IntSize& size, GrSurfaceOrigin origin, GrPixelConfig config) 38 bool ensureTextureBackedSkBitmap(GrContext* gr, SkBitmap& bitmap, const IntSize& size, GrSurfaceOrigin origin, GrPixelConfig config)
39 { 39 {
40 if (!bitmap.getTexture() || bitmap.width() != size.width() || bitmap.height( ) != size.height()) { 40 if (!bitmap.getTexture() || bitmap.width() != size.width() || bitmap.height( ) != size.height()) {
41 if (!gr) 41 if (!gr)
42 return false; 42 return false;
43 GrTextureDesc desc; 43 GrTextureDesc desc;
44 desc.fConfig = config; 44 desc.fConfig = config;
45 desc.fFlags = kRenderTarget_GrTextureFlagBit | kNoStencil_GrTextureFlagB it; 45 desc.fFlags = kRenderTarget_GrSurfaceFlag;
46 desc.fSampleCnt = 0; 46 desc.fSampleCnt = 0;
47 desc.fOrigin = origin; 47 desc.fOrigin = origin;
48 desc.fWidth = size.width(); 48 desc.fWidth = size.width();
49 desc.fHeight = size.height(); 49 desc.fHeight = size.height();
50 SkAutoTUnref<GrTexture> texture(gr->createUncachedTexture(desc, 0, 0)); 50 SkAutoTUnref<GrTexture> texture(gr->textureProvider()->createTexture(des c, false, 0, 0));
51 if (!texture.get()) 51 if (!texture.get())
52 return false; 52 return false;
53 53
54 SkImageInfo info = SkImageInfo::MakeN32Premul(desc.fWidth, desc.fHeight) ; 54 SkImageInfo info = SkImageInfo::MakeN32Premul(desc.fWidth, desc.fHeight) ;
55 SkGrPixelRef* pixelRef = SkNEW_ARGS(SkGrPixelRef, (info, texture.get())) ; 55 SkGrPixelRef* pixelRef = SkNEW_ARGS(SkGrPixelRef, (info, texture.get())) ;
56 if (!pixelRef) 56 if (!pixelRef)
57 return false; 57 return false;
58 bitmap.setInfo(info); 58 bitmap.setInfo(info);
59 bitmap.setPixelRef(pixelRef)->unref(); 59 bitmap.setPixelRef(pixelRef)->unref();
60 } 60 }
61 61
62 return true; 62 return true;
63 } 63 }
64 64
65 } // namespace blink 65 } // namespace blink
OLDNEW
« no previous file with comments | « sky/engine/platform/graphics/Path.cpp ('k') | sky/engine/platform/graphics/skia/SkiaUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698