Separate Simple Backend creation from initialization.
[chromium-blink-merge.git] / ui / gfx / image / image_png_rep.h
blob466e37c1ac9236b460361dc5320f8683997bd943
1 // Copyright (c) 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 UI_GFX_IMAGE_IMAGE_PNG_REP_H_
6 #define UI_GFX_IMAGE_IMAGE_PNG_REP_H_
8 #include "base/memory/ref_counted_memory.h"
9 #include "ui/base/layout.h"
10 #include "ui/base/ui_export.h"
12 namespace gfx {
13 class Size;
15 // An ImagePNGRep represents a bitmap's png encoded data and the scale factor it
16 // was intended for.
17 struct UI_EXPORT ImagePNGRep {
18 ImagePNGRep();
19 ImagePNGRep(const scoped_refptr<base::RefCountedMemory>& data,
20 ui::ScaleFactor data_scale_factor);
21 ~ImagePNGRep();
23 // Width and height of the image, in pixels.
24 // If the image is invalid, returns gfx::Size(0, 0).
25 // Warning: This operation processes the entire image stream, so its result
26 // should be cached if it is needed multiple times.
27 gfx::Size Size() const;
29 scoped_refptr<base::RefCountedMemory> raw_data;
30 ui::ScaleFactor scale_factor;
33 } // namespace gfx
35 #endif // UI_GFX_IMAGE_IMAGE_PNG_REP_H_