| OLD | NEW | 
|---|
| (Empty) |  | 
|  | 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 
|  | 2 // Use of this source code is governed by a BSD-style license that can be | 
|  | 3 // found in the LICENSE file. | 
|  | 4 | 
|  | 5 #ifndef CC_RESOURCES_CLIP_DISPLAY_ITEM_H_ | 
|  | 6 #define CC_RESOURCES_CLIP_DISPLAY_ITEM_H_ | 
|  | 7 | 
|  | 8 #include <vector> | 
|  | 9 | 
|  | 10 #include "base/memory/scoped_ptr.h" | 
|  | 11 #include "cc/base/cc_export.h" | 
|  | 12 #include "cc/resources/display_item.h" | 
|  | 13 #include "third_party/skia/include/core/SkRRect.h" | 
|  | 14 #include "ui/gfx/geometry/rect.h" | 
|  | 15 | 
|  | 16 class SkCanvas; | 
|  | 17 class SkDrawPictureCallback; | 
|  | 18 | 
|  | 19 namespace cc { | 
|  | 20 | 
|  | 21 class CC_EXPORT ClipDisplayItem : public DisplayItem { | 
|  | 22  public: | 
|  | 23   virtual ~ClipDisplayItem(); | 
|  | 24 | 
|  | 25   static scoped_ptr<ClipDisplayItem> Create( | 
|  | 26       gfx::Rect clip_rect, | 
|  | 27       const std::vector<SkRRect>& rounded_clip_rects) { | 
|  | 28     return make_scoped_ptr(new ClipDisplayItem(clip_rect, rounded_clip_rects)); | 
|  | 29   } | 
|  | 30 | 
|  | 31   void Raster(SkCanvas* canvas, SkDrawPictureCallback* callback) const override; | 
|  | 32 | 
|  | 33   bool IsSuitableForGpuRasterization() const override; | 
|  | 34   int ApproximateOpCount() const override; | 
|  | 35   size_t PictureMemoryUsage() const override; | 
|  | 36 | 
|  | 37  protected: | 
|  | 38   ClipDisplayItem(gfx::Rect clip_rect, | 
|  | 39                   const std::vector<SkRRect>& rounded_clip_rects); | 
|  | 40 | 
|  | 41  private: | 
|  | 42   gfx::Rect clip_rect_; | 
|  | 43   std::vector<SkRRect> rounded_clip_rects_; | 
|  | 44 }; | 
|  | 45 | 
|  | 46 class CC_EXPORT EndClipDisplayItem : public DisplayItem { | 
|  | 47  public: | 
|  | 48   virtual ~EndClipDisplayItem(); | 
|  | 49 | 
|  | 50   static scoped_ptr<EndClipDisplayItem> Create() { | 
|  | 51     return make_scoped_ptr(new EndClipDisplayItem()); | 
|  | 52   } | 
|  | 53 | 
|  | 54   void Raster(SkCanvas* canvas, SkDrawPictureCallback* callback) const override; | 
|  | 55 | 
|  | 56   bool IsSuitableForGpuRasterization() const override; | 
|  | 57   int ApproximateOpCount() const override; | 
|  | 58   size_t PictureMemoryUsage() const override; | 
|  | 59 | 
|  | 60  protected: | 
|  | 61   EndClipDisplayItem(); | 
|  | 62 }; | 
|  | 63 | 
|  | 64 }  // namespace cc | 
|  | 65 | 
|  | 66 #endif  // CC_RESOURCES_CLIP_DISPLAY_ITEM_H_ | 
| OLD | NEW | 
|---|