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

Side by Side Diff: skia/effects/SkLayerRasterizer.cpp

Issue 93093: Implement canvas's globalCompositeOperation lighter properly.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « skia/effects/SkKernel33MaskFilter.cpp ('k') | skia/include/SkMask.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* libs/graphics/effects/SkLayerRasterizer.cpp 1 /* libs/graphics/effects/SkLayerRasterizer.cpp
2 ** 2 **
3 ** Copyright 2006, The Android Open Source Project 3 ** Copyright 2006, The Android Open Source Project
4 ** 4 **
5 ** Licensed under the Apache License, Version 2.0 (the "License"); 5 ** Licensed under the Apache License, Version 2.0 (the "License");
6 ** you may not use this file except in compliance with the License. 6 ** you may not use this file except in compliance with the License.
7 ** You may obtain a copy of the License at 7 ** You may obtain a copy of the License at
8 ** 8 **
9 ** http://www.apache.org/licenses/LICENSE-2.0 9 ** http://www.apache.org/licenses/LICENSE-2.0
10 ** 10 **
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 if (SkMask::kJustRenderImage_CreateMode != mode) 101 if (SkMask::kJustRenderImage_CreateMode != mode)
102 { 102 {
103 if (!compute_bounds(fLayers, path, matrix, clipBounds, &mask->fBounds)) 103 if (!compute_bounds(fLayers, path, matrix, clipBounds, &mask->fBounds))
104 return false; 104 return false;
105 } 105 }
106 106
107 if (SkMask::kComputeBoundsAndRenderImage_CreateMode == mode) 107 if (SkMask::kComputeBoundsAndRenderImage_CreateMode == mode)
108 { 108 {
109 mask->fFormat = SkMask::kA8_Format; 109 mask->fFormat = SkMask::kA8_Format;
110 mask->fRowBytes = SkToU16(mask->fBounds.width()); 110 mask->fRowBytes = SkToU16(mask->fBounds.width());
111 mask->fImage = SkMask::AllocImage(mask->computeImageSize()); 111 size_t size = mask->computeImageSize();
112 memset(mask->fImage, 0, mask->computeImageSize()); 112 if (0 == size) {
113 return false; // too big to allocate, abort
114 }
115 mask->fImage = SkMask::AllocImage(size);
116 memset(mask->fImage, 0, size);
113 } 117 }
114 118
115 if (SkMask::kJustComputeBounds_CreateMode != mode) 119 if (SkMask::kJustComputeBounds_CreateMode != mode)
116 { 120 {
117 SkBitmap device; 121 SkBitmap device;
118 SkDraw draw; 122 SkDraw draw;
119 SkMatrix translatedMatrix; // this translates us to our local pixels 123 SkMatrix translatedMatrix; // this translates us to our local pixels
120 SkMatrix drawMatrix; // this translates the path by each layer's offset 124 SkMatrix drawMatrix; // this translates the path by each layer's offset
121 SkRegion rectClip; 125 SkRegion rectClip;
122 126
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 SkFlattenable* SkLayerRasterizer::CreateProc(SkFlattenableReadBuffer& buffer) 237 SkFlattenable* SkLayerRasterizer::CreateProc(SkFlattenableReadBuffer& buffer)
234 { 238 {
235 return SkNEW_ARGS(SkLayerRasterizer, (buffer)); 239 return SkNEW_ARGS(SkLayerRasterizer, (buffer));
236 } 240 }
237 241
238 SkFlattenable::Factory SkLayerRasterizer::getFactory() 242 SkFlattenable::Factory SkLayerRasterizer::getFactory()
239 { 243 {
240 return CreateProc; 244 return CreateProc;
241 } 245 }
242 246
OLDNEW
« no previous file with comments | « skia/effects/SkKernel33MaskFilter.cpp ('k') | skia/include/SkMask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698