Paint_refDrawLooper.cpp 716 B

12345678910111213141516
  1. // Copyright 2019 Google LLC.
  2. // Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
  3. #include "tools/fiddle/examples.h"
  4. // HASH=2a3782c33f04ed17a725d0e449c6f7c3
  5. REG_FIDDLE(Paint_refDrawLooper, 256, 256, true, 0) {
  6. void draw(SkCanvas* canvas) {
  7. #ifdef SK_SUPPORT_LEGACY_DRAWLOOPER
  8. SkPaint paint1, paint2;
  9. SkLayerDrawLooper::Builder looperBuilder;
  10. paint1.setDrawLooper(looperBuilder.detach());
  11. SkDebugf("draw looper unique: %s\n", paint1.getDrawLooper()->unique() ? "true" : "false");
  12. paint2.setDrawLooper(paint1.refDrawLooper());
  13. SkDebugf("draw looper unique: %s\n", paint1.getDrawLooper()->unique() ? "true" : "false");
  14. #endif
  15. }
  16. } // END FIDDLE