Use SCHEME_HTTP for HTTPS proxies on Android.
[chromium-blink-merge.git] / cc / nine_patch_layer.h
blob6a8c613edf91342e9683d5c2da1e87c60db72926
1 // Copyright 2012 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.
5 #ifndef CC_NINE_PATCH_LAYER_H_
6 #define CC_NINE_PATCH_LAYER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "cc/cc_export.h"
10 #include "cc/layer.h"
11 #include "cc/image_layer_updater.h"
12 #include "ui/gfx/rect.h"
13 #include "third_party/skia/include/core/SkBitmap.h"
15 namespace cc {
17 class ResourceUpdateQueue;
19 class CC_EXPORT NinePatchLayer : public Layer {
20 public:
21 static scoped_refptr<NinePatchLayer> create();
23 virtual bool drawsContent() const OVERRIDE;
24 virtual void setTexturePriorities(const PriorityCalculator&) OVERRIDE;
25 virtual void update(ResourceUpdateQueue&, const OcclusionTracker*, RenderingStats&) OVERRIDE;
26 virtual void pushPropertiesTo(LayerImpl*) OVERRIDE;
28 // aperture is in the pixel space of the bitmap resource and refers to
29 // the center patch of the ninepatch (which is unused in this
30 // implementation). We split off eight rects surrounding it and stick them
31 // on the edges of the layer. The corners are unscaled, the top and bottom
32 // rects are x-stretched to fit, and the left and right rects are
33 // y-stretched to fit.
34 void setBitmap(const SkBitmap& bitmap, const gfx::Rect& aperture);
36 private:
37 NinePatchLayer();
38 virtual ~NinePatchLayer();
39 virtual scoped_ptr<LayerImpl> createLayerImpl(LayerTreeHostImpl* hostImpl) OVERRIDE;
41 void createUpdaterIfNeeded();
42 void createResource();
44 scoped_refptr<ImageLayerUpdater> m_updater;
45 scoped_ptr<LayerUpdater::Resource> m_resource;
47 SkBitmap m_bitmap;
48 bool m_bitmapDirty;
50 // The transparent center region that shows the parent layer's contents in image space.
51 gfx::Rect m_imageAperture;
54 } // namespace cc
56 #endif // CC_NINE_PATCH_LAYER_H_