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

Side by Side Diff: src/core/SkPictureShader.cpp

Issue 769953002: Remove SK_SUPPORT_LEGACY_DEEPFLATTENING. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years 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/core/SkPathEffect.cpp ('k') | src/core/SkShader.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 2014 Google Inc. 2 * Copyright 2014 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 "SkPictureShader.h" 8 #include "SkPictureShader.h"
9 9
10 #include "SkBitmap.h" 10 #include "SkBitmap.h"
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 93
94 SkPictureShader::SkPictureShader(const SkPicture* picture, TileMode tmx, TileMod e tmy, 94 SkPictureShader::SkPictureShader(const SkPicture* picture, TileMode tmx, TileMod e tmy,
95 const SkMatrix* localMatrix, const SkRect* tile ) 95 const SkMatrix* localMatrix, const SkRect* tile )
96 : INHERITED(localMatrix) 96 : INHERITED(localMatrix)
97 , fPicture(SkRef(picture)) 97 , fPicture(SkRef(picture))
98 , fTile(tile ? *tile : picture->cullRect()) 98 , fTile(tile ? *tile : picture->cullRect())
99 , fTmx(tmx) 99 , fTmx(tmx)
100 , fTmy(tmy) { 100 , fTmy(tmy) {
101 } 101 }
102 102
103 #ifdef SK_SUPPORT_LEGACY_DEEPFLATTENING
104 SkPictureShader::SkPictureShader(SkReadBuffer& buffer) : INHERITED(buffer) {
105 fTmx = static_cast<SkShader::TileMode>(buffer.read32());
106 fTmy = static_cast<SkShader::TileMode>(buffer.read32());
107 buffer.readRect(&fTile);
108 fPicture = SkPicture::CreateFromBuffer(buffer);
109 }
110 #endif
111
112 SkPictureShader::~SkPictureShader() { 103 SkPictureShader::~SkPictureShader() {
113 fPicture->unref(); 104 fPicture->unref();
114 } 105 }
115 106
116 SkPictureShader* SkPictureShader::Create(const SkPicture* picture, TileMode tmx, TileMode tmy, 107 SkPictureShader* SkPictureShader::Create(const SkPicture* picture, TileMode tmx, TileMode tmy,
117 const SkMatrix* localMatrix, const SkRe ct* tile) { 108 const SkMatrix* localMatrix, const SkRe ct* tile) {
118 if (!picture || picture->cullRect().isEmpty() || (tile && tile->isEmpty())) { 109 if (!picture || picture->cullRect().isEmpty() || (tile && tile->isEmpty())) {
119 return NULL; 110 return NULL;
120 } 111 }
121 return SkNEW_ARGS(SkPictureShader, (picture, tmx, tmy, localMatrix, tile)); 112 return SkNEW_ARGS(SkPictureShader, (picture, tmx, tmy, localMatrix, tile));
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
297 } 288 }
298 return bitmapShader->asFragmentProcessor(context, paint, NULL, paintColor, f p); 289 return bitmapShader->asFragmentProcessor(context, paint, NULL, paintColor, f p);
299 } 290 }
300 #else 291 #else
301 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa trix*, GrColor*, 292 bool SkPictureShader::asFragmentProcessor(GrContext*, const SkPaint&, const SkMa trix*, GrColor*,
302 GrFragmentProcessor**) const { 293 GrFragmentProcessor**) const {
303 SkDEBUGFAIL("Should not call in GPU-less build"); 294 SkDEBUGFAIL("Should not call in GPU-less build");
304 return false; 295 return false;
305 } 296 }
306 #endif 297 #endif
OLDNEW
« no previous file with comments | « src/core/SkPathEffect.cpp ('k') | src/core/SkShader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698