Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Unified Diff: runtime/embedders/openglui/common/canvas_context.h

Issue 12340036: Android improvements: (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/embedders/openglui/android/main.cc ('k') | runtime/embedders/openglui/common/canvas_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/embedders/openglui/common/canvas_context.h
===================================================================
--- runtime/embedders/openglui/common/canvas_context.h (revision 18917)
+++ runtime/embedders/openglui/common/canvas_context.h (working copy)
@@ -27,11 +27,9 @@
class CanvasContext {
protected:
SkCanvas* canvas_;
-
int16_t width_, height_;
-
bool imageSmoothingEnabled_;
-
+ bool isDirty_;
CanvasState* state_;
static inline float Radians2Degrees(float angle) {
@@ -46,6 +44,14 @@
CanvasContext(int handle, int16_t width, int16_t height);
virtual ~CanvasContext();
+ inline bool isDirty() {
+ return isDirty_;
+ }
+
+ inline void clearDirty() {
+ isDirty_ = false;
+ }
+
inline void setGlobalAlpha(float alpha) {
state_->setGlobalAlpha(alpha);
}
@@ -165,6 +171,7 @@
inline void Clear() {
canvas_->drawColor(0xFFFFFFFF);
+ isDirty_ = true;
}
void ClearRect(float left, float top, float width, float height);
@@ -172,11 +179,13 @@
inline void FillRect(float left, float top, float width, float height) {
// Does not affect the path.
state_->FillRect(left, top, width, height);
+ isDirty_ = true;
}
inline void StrokeRect(float left, float top, float width, float height) {
// Does not affect the path.
state_->StrokeRect(left, top, width, height);
+ isDirty_ = true;
}
inline void BeginPath() {
@@ -185,10 +194,12 @@
inline void Fill() {
state_->Fill();
+ isDirty_ = true;
}
inline void Stroke() {
state_->Stroke();
+ isDirty_ = true;
}
inline void ClosePath() {
@@ -269,11 +280,13 @@
inline void FillText(const char* text, float x, float y,
float maxWidth = -1) {
state_->FillText(text, x, y, maxWidth);
+ isDirty_ = true;
}
inline void StrokeText(const char* text, float x, float y,
float maxWidth = -1) {
state_->StrokeText(text, x, y, maxWidth);
+ isDirty_ = true;
}
inline float MeasureText(const char *text) {
@@ -296,6 +309,7 @@
};
CanvasContext* Context2D(int handle);
+void FreeContexts();
#endif // EMBEDDERS_OPENGLUI_COMMON_CANVAS_CONTEXT_H_
« no previous file with comments | « runtime/embedders/openglui/android/main.cc ('k') | runtime/embedders/openglui/common/canvas_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698