| OLD | NEW | 
|---|
| 1 | 1 | 
| 2 /* | 2 /* | 
| 3  * Copyright 2015 Google Inc. | 3  * Copyright 2015 Google Inc. | 
| 4  * | 4  * | 
| 5  * Use of this source code is governed by a BSD-style license that can be | 5  * Use of this source code is governed by a BSD-style license that can be | 
| 6  * found in the LICENSE file. | 6  * found in the LICENSE file. | 
| 7  */ | 7  */ | 
| 8 | 8 | 
| 9 #include "Test.h" | 9 #include "Test.h" | 
| 10 // This is a GR test | 10 // This is a GR test | 
| 11 #if SK_SUPPORT_GPU | 11 #if SK_SUPPORT_GPU | 
| 12 #include "GrClipMaskManager.h" | 12 #include "GrClipMaskManager.h" | 
| 13 #include "GrContext.h" | 13 #include "GrContext.h" | 
| 14 | 14 | 
| 15 // Ensure that the 'getConservativeBounds' calls are returning bounds clamped | 15 // Ensure that the 'getConservativeBounds' calls are returning bounds clamped | 
| 16 // to the render target | 16 // to the render target | 
| 17 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrClipBounds, reporter, context) { | 17 DEF_GPUTEST_FOR_RENDERING_CONTEXTS(GrClipBounds, reporter, context) { | 
| 18     static const int kXSize = 100; | 18     static const int kXSize = 100; | 
| 19     static const int kYSize = 100; | 19     static const int kYSize = 100; | 
| 20 | 20 | 
| 21     GrSurfaceDesc desc; | 21     GrSurfaceDesc desc; | 
| 22     desc.fFlags     = kRenderTarget_GrSurfaceFlag; | 22     desc.fFlags     = kRenderTarget_GrSurfaceFlag; | 
| 23     desc.fConfig    = kAlpha_8_GrPixelConfig; | 23     desc.fConfig    = kAlpha_8_GrPixelConfig; | 
| 24     desc.fWidth     = kXSize; | 24     desc.fWidth     = kXSize; | 
| 25     desc.fHeight    = kYSize; | 25     desc.fHeight    = kYSize; | 
| 26 | 26 | 
| 27     SkAutoTUnref<GrTexture> texture( | 27     SkAutoTUnref<GrTexture> texture( | 
| 28         context->textureProvider()->createTexture(desc, SkBudgeted::kYes, nullpt
    r, 0)); | 28         context->textureProvider()->createTexture(desc, false, nullptr, 0)); | 
| 29     if (!texture) { | 29     if (!texture) { | 
| 30         return; | 30         return; | 
| 31     } | 31     } | 
| 32 | 32 | 
| 33     SkIRect intScreen = SkIRect::MakeWH(kXSize, kYSize); | 33     SkIRect intScreen = SkIRect::MakeWH(kXSize, kYSize); | 
| 34     SkRect screen = SkRect::Make(intScreen); | 34     SkRect screen = SkRect::Make(intScreen); | 
| 35 | 35 | 
| 36     SkRect clipRect(screen); | 36     SkRect clipRect(screen); | 
| 37     clipRect.outset(10, 10); | 37     clipRect.outset(10, 10); | 
| 38 | 38 | 
| (...skipping 21 matching lines...) Expand all  Loading... | 
| 60     clipData.getConservativeBounds(texture->width(), texture->height(), | 60     clipData.getConservativeBounds(texture->width(), texture->height(), | 
| 61                                    &devGrClipBound, | 61                                    &devGrClipBound, | 
| 62                                    &isIntersectionOfRects); | 62                                    &isIntersectionOfRects); | 
| 63 | 63 | 
| 64     // make sure that GrClip is behaving itself | 64     // make sure that GrClip is behaving itself | 
| 65     REPORTER_ASSERT(reporter, intScreen == devGrClipBound); | 65     REPORTER_ASSERT(reporter, intScreen == devGrClipBound); | 
| 66     REPORTER_ASSERT(reporter, isIntersectionOfRects); | 66     REPORTER_ASSERT(reporter, isIntersectionOfRects); | 
| 67 } | 67 } | 
| 68 | 68 | 
| 69 #endif | 69 #endif | 
| OLD | NEW | 
|---|