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

Side by Side Diff: src/effects/SkDisplacementMapEffect.cpp

Issue 938383004: Dynamically create stencil buffer when needed. (Closed) Base URL: https://skia.googlesource.com/skia.git@bigstencil
Patch Set: Actually save file before uploading Created 5 years, 10 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 | « src/effects/SkAlphaThresholdFilter.cpp ('k') | src/effects/SkGpuBlurUtils.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 2013 Google Inc. 2 * Copyright 2013 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 "SkDisplacementMapEffect.h" 8 #include "SkDisplacementMapEffect.h"
9 #include "SkReadBuffer.h" 9 #include "SkReadBuffer.h"
10 #include "SkWriteBuffer.h" 10 #include "SkWriteBuffer.h"
(...skipping 399 matching lines...) Expand 10 before | Expand all | Expand 10 after
410 return false; 410 return false;
411 } 411 }
412 if (!bounds.intersect(displBounds)) { 412 if (!bounds.intersect(displBounds)) {
413 return false; 413 return false;
414 } 414 }
415 GrTexture* color = colorBM.getTexture(); 415 GrTexture* color = colorBM.getTexture();
416 GrTexture* displacement = displacementBM.getTexture(); 416 GrTexture* displacement = displacementBM.getTexture();
417 GrContext* context = color->getContext(); 417 GrContext* context = color->getContext();
418 418
419 GrSurfaceDesc desc; 419 GrSurfaceDesc desc;
420 desc.fFlags = kRenderTarget_GrSurfaceFlag | kNoStencil_GrSurfaceFlag; 420 desc.fFlags = kRenderTarget_GrSurfaceFlag;
421 desc.fWidth = bounds.width(); 421 desc.fWidth = bounds.width();
422 desc.fHeight = bounds.height(); 422 desc.fHeight = bounds.height();
423 desc.fConfig = kSkia8888_GrPixelConfig; 423 desc.fConfig = kSkia8888_GrPixelConfig;
424 424
425 SkAutoTUnref<GrTexture> dst( 425 SkAutoTUnref<GrTexture> dst(
426 context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch)); 426 context->refScratchTexture(desc, GrContext::kApprox_ScratchTexMatch));
427 427
428 if (!dst) { 428 if (!dst) {
429 return false; 429 return false;
430 } 430 }
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 const GrGLCaps&, GrProcessorKeyBuilder* b ) { 630 const GrGLCaps&, GrProcessorKeyBuilder* b ) {
631 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>(); 631 const GrDisplacementMapEffect& displacementMap = proc.cast<GrDisplacementMap Effect>();
632 632
633 uint32_t xKey = displacementMap.xChannelSelector(); 633 uint32_t xKey = displacementMap.xChannelSelector();
634 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s; 634 uint32_t yKey = displacementMap.yChannelSelector() << kChannelSelectorKeyBit s;
635 635
636 b->add32(xKey | yKey); 636 b->add32(xKey | yKey);
637 } 637 }
638 #endif 638 #endif
639 639
OLDNEW
« no previous file with comments | « src/effects/SkAlphaThresholdFilter.cpp ('k') | src/effects/SkGpuBlurUtils.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698