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

Side by Side Diff: src/gpu/SkGr.cpp

Issue 855953005: Broken dm fix (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 11 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 | no next file » | 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 2010 Google Inc. 2 * Copyright 2010 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 "SkGr.h" 8 #include "SkGr.h"
9 9
10 #include "GrDrawTargetCaps.h" 10 #include "GrDrawTargetCaps.h"
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after
228 (pixelRef->info().width() != bm.info().width()) || 228 (pixelRef->info().width() != bm.info().width()) ||
229 (pixelRef->info().height() != bm.info().height())) { 229 (pixelRef->info().height() != bm.info().height())) {
230 return NULL; 230 return NULL;
231 } 231 }
232 232
233 SkYUVPlanesCache::Info yuvInfo; 233 SkYUVPlanesCache::Info yuvInfo;
234 SkAutoTUnref<SkCachedData> cachedData( 234 SkAutoTUnref<SkCachedData> cachedData(
235 SkYUVPlanesCache::FindAndRef(pixelRef->getGenerationID(), &yuvInfo)); 235 SkYUVPlanesCache::FindAndRef(pixelRef->getGenerationID(), &yuvInfo));
236 236
237 void* planes[3]; 237 void* planes[3];
238 if (cachedData->data()) { 238 if (cachedData && cachedData->data()) {
239 planes[0] = (void*)cachedData->data(); 239 planes[0] = (void*)cachedData->data();
240 planes[1] = (uint8_t*)planes[0] + yuvInfo.fSizeInMemory[0]; 240 planes[1] = (uint8_t*)planes[0] + yuvInfo.fSizeInMemory[0];
241 planes[2] = (uint8_t*)planes[1] + yuvInfo.fSizeInMemory[1]; 241 planes[2] = (uint8_t*)planes[1] + yuvInfo.fSizeInMemory[1];
242 } else { 242 } else {
243 // Fetch yuv plane sizes for memory allocation. Here, width and height c an be 243 // Fetch yuv plane sizes for memory allocation. Here, width and height c an be
244 // rounded up to JPEG block size and be larger than the image's width an d height. 244 // rounded up to JPEG block size and be larger than the image's width an d height.
245 if (!pixelRef->getYUV8Planes(yuvInfo.fSize, NULL, NULL, NULL)) { 245 if (!pixelRef->getYUV8Planes(yuvInfo.fSize, NULL, NULL, NULL)) {
246 return NULL; 246 return NULL;
247 } 247 }
248 248
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) { 597 if (shader->asFragmentProcessor(context, skPaint, viewM, NULL, &paintCol or, &fp) && fp) {
598 grPaint->addColorProcessor(fp)->unref(); 598 grPaint->addColorProcessor(fp)->unref();
599 constantColor = false; 599 constantColor = false;
600 } 600 }
601 } 601 }
602 602
603 // The grcolor is automatically set when calling asFragmentProcessor. 603 // The grcolor is automatically set when calling asFragmentProcessor.
604 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint. 604 // If the shader can be seen as an effect it returns true and adds its effec t to the grpaint.
605 SkPaint2GrPaintNoShader(context, skPaint, paintColor, constantColor, grPaint ); 605 SkPaint2GrPaintNoShader(context, skPaint, paintColor, constantColor, grPaint );
606 } 606 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698